/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    'cn-qingdao' = 'ess.aliyuncs.com',
    'cn-beijing' = 'ess.aliyuncs.com',
    'cn-hangzhou' = 'ess.aliyuncs.com',
    'cn-shanghai' = 'ess.aliyuncs.com',
    'cn-shenzhen' = 'ess.aliyuncs.com',
    'cn-hongkong' = 'ess.aliyuncs.com',
    'ap-southeast-1' = 'ess.aliyuncs.com',
    'us-east-1' = 'ess.aliyuncs.com',
    'us-west-1' = 'ess.aliyuncs.com',
    'cn-shanghai-finance-1' = 'ess.aliyuncs.com',
    'cn-shenzhen-finance-1' = 'ess.aliyuncs.com',
    'cn-north-2-gov-1' = 'ess.aliyuncs.com',
    'ap-northeast-2-pop' = 'ess.aliyuncs.com',
    'cn-beijing-finance-pop' = 'ess.aliyuncs.com',
    'cn-beijing-gov-1' = 'ess.aliyuncs.com',
    'cn-beijing-nu16-b01' = 'ess.aliyuncs.com',
    'cn-edge-1' = 'ess.aliyuncs.com',
    'cn-fujian' = 'ess.aliyuncs.com',
    'cn-haidian-cm12-c01' = 'ess.aliyuncs.com',
    'cn-hangzhou-bj-b01' = 'ess.aliyuncs.com',
    'cn-hangzhou-finance' = 'ess.aliyuncs.com',
    'cn-hangzhou-internal-prod-1' = 'ess.aliyuncs.com',
    'cn-hangzhou-internal-test-1' = 'ess.aliyuncs.com',
    'cn-hangzhou-internal-test-2' = 'ess.aliyuncs.com',
    'cn-hangzhou-internal-test-3' = 'ess.aliyuncs.com',
    'cn-hangzhou-test-306' = 'ess.aliyuncs.com',
    'cn-hongkong-finance-pop' = 'ess.aliyuncs.com',
    'cn-huhehaote-nebula-1' = 'ess.aliyuncs.com',
    'cn-qingdao-nebula' = 'ess.aliyuncs.com',
    'cn-shanghai-et15-b01' = 'ess.aliyuncs.com',
    'cn-shanghai-et2-b01' = 'ess.aliyuncs.com',
    'cn-shanghai-inner' = 'ess.aliyuncs.com',
    'cn-shanghai-internal-test-1' = 'ess.aliyuncs.com',
    'cn-shenzhen-inner' = 'ess.aliyuncs.com',
    'cn-shenzhen-st4-d01' = 'ess.aliyuncs.com',
    'cn-shenzhen-su18-b01' = 'ess.aliyuncs.com',
    'cn-wuhan' = 'ess.aliyuncs.com',
    'cn-yushanfang' = 'ess.aliyuncs.com',
    'cn-zhangbei' = 'ess.aliyuncs.com',
    'cn-zhangbei-na61-b01' = 'ess.aliyuncs.com',
    'cn-zhangjiakou-na62-a01' = 'ess.aliyuncs.com',
    'cn-zhengzhou-nebula-1' = 'ess.aliyuncs.com',
    'eu-west-1-oxs' = 'ess.aliyuncs.com',
    'rus-west-1-pop' = 'ess.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('ess', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AttachAlbServerGroupsRequest {
  albServerGroup?: [ 
    {
      albServerGroupId?: string(name='AlbServerGroupId'),
      port?: int32(name='Port'),
      weight?: int32(name='Weight'),
    }
  ](name='AlbServerGroup'),
  clientToken?: string(name='ClientToken'),
  forceAttach?: boolean(name='ForceAttach'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model AttachAlbServerGroupsResponseBody = {
  requestId?: string(name='RequestId'),
  scalingActivityId?: string(name='ScalingActivityId'),
}

model AttachAlbServerGroupsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AttachAlbServerGroupsResponseBody(name='body'),
}

async function attachAlbServerGroupsWithOptions(request: AttachAlbServerGroupsRequest, runtime: Util.RuntimeOptions): AttachAlbServerGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.albServerGroup)) {
    query['AlbServerGroup'] = request.albServerGroup;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.forceAttach)) {
    query['ForceAttach'] = request.forceAttach;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AttachAlbServerGroups',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function attachAlbServerGroups(request: AttachAlbServerGroupsRequest): AttachAlbServerGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return attachAlbServerGroupsWithOptions(request, runtime);
}

model AttachDBInstancesRequest {
  clientToken?: string(name='ClientToken'),
  DBInstance?: [ string ](name='DBInstance'),
  forceAttach?: boolean(name='ForceAttach'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model AttachDBInstancesResponseBody = {
  requestId?: string(name='RequestId'),
}

model AttachDBInstancesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AttachDBInstancesResponseBody(name='body'),
}

async function attachDBInstancesWithOptions(request: AttachDBInstancesRequest, runtime: Util.RuntimeOptions): AttachDBInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.DBInstance)) {
    query['DBInstance'] = request.DBInstance;
  }
  if (!Util.isUnset(request.forceAttach)) {
    query['ForceAttach'] = request.forceAttach;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AttachDBInstances',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function attachDBInstances(request: AttachDBInstancesRequest): AttachDBInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return attachDBInstancesWithOptions(request, runtime);
}

model AttachInstancesRequest {
  entrusted?: boolean(name='Entrusted'),
  instanceId?: [ string ](name='InstanceId'),
  lifecycleHook?: boolean(name='LifecycleHook'),
  loadBalancerWeight?: [ int32 ](name='LoadBalancerWeight'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model AttachInstancesResponseBody = {
  requestId?: string(name='RequestId'),
  scalingActivityId?: string(name='ScalingActivityId'),
}

model AttachInstancesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AttachInstancesResponseBody(name='body'),
}

async function attachInstancesWithOptions(request: AttachInstancesRequest, runtime: Util.RuntimeOptions): AttachInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.entrusted)) {
    query['Entrusted'] = request.entrusted;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.lifecycleHook)) {
    query['LifecycleHook'] = request.lifecycleHook;
  }
  if (!Util.isUnset(request.loadBalancerWeight)) {
    query['LoadBalancerWeight'] = request.loadBalancerWeight;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AttachInstances',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function attachInstances(request: AttachInstancesRequest): AttachInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return attachInstancesWithOptions(request, runtime);
}

model AttachLoadBalancersRequest {
  async?: boolean(name='Async'),
  clientToken?: string(name='ClientToken'),
  forceAttach?: boolean(name='ForceAttach'),
  loadBalancer?: [ string ](name='LoadBalancer'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model AttachLoadBalancersResponseBody = {
  requestId?: string(name='RequestId'),
  scalingActivityId?: string(name='ScalingActivityId'),
}

model AttachLoadBalancersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AttachLoadBalancersResponseBody(name='body'),
}

async function attachLoadBalancersWithOptions(request: AttachLoadBalancersRequest, runtime: Util.RuntimeOptions): AttachLoadBalancersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.async)) {
    query['Async'] = request.async;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.forceAttach)) {
    query['ForceAttach'] = request.forceAttach;
  }
  if (!Util.isUnset(request.loadBalancer)) {
    query['LoadBalancer'] = request.loadBalancer;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AttachLoadBalancers',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function attachLoadBalancers(request: AttachLoadBalancersRequest): AttachLoadBalancersResponse {
  var runtime = new Util.RuntimeOptions{};
  return attachLoadBalancersWithOptions(request, runtime);
}

model AttachVServerGroupsRequest {
  clientToken?: string(name='ClientToken'),
  forceAttach?: boolean(name='ForceAttach'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
  VServerGroup?: [ 
    {
      loadBalancerId?: string(name='LoadBalancerId'),
      VServerGroupAttribute?: [ 
        {
          port?: int32(name='Port'),
          VServerGroupId?: string(name='VServerGroupId'),
          weight?: int32(name='Weight'),
        }
      ](name='VServerGroupAttribute'),
    }
  ](name='VServerGroup'),
}

model AttachVServerGroupsResponseBody = {
  requestId?: string(name='RequestId'),
}

model AttachVServerGroupsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AttachVServerGroupsResponseBody(name='body'),
}

async function attachVServerGroupsWithOptions(request: AttachVServerGroupsRequest, runtime: Util.RuntimeOptions): AttachVServerGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.forceAttach)) {
    query['ForceAttach'] = request.forceAttach;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  if (!Util.isUnset(request.VServerGroup)) {
    query['VServerGroup'] = request.VServerGroup;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AttachVServerGroups',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function attachVServerGroups(request: AttachVServerGroupsRequest): AttachVServerGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return attachVServerGroupsWithOptions(request, runtime);
}

model CompleteLifecycleActionRequest {
  clientToken?: string(name='ClientToken'),
  lifecycleActionResult?: string(name='LifecycleActionResult'),
  lifecycleActionToken?: string(name='LifecycleActionToken'),
  lifecycleHookId?: string(name='LifecycleHookId'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
}

model CompleteLifecycleActionResponseBody = {
  requestId?: string(name='RequestId'),
}

model CompleteLifecycleActionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CompleteLifecycleActionResponseBody(name='body'),
}

async function completeLifecycleActionWithOptions(request: CompleteLifecycleActionRequest, runtime: Util.RuntimeOptions): CompleteLifecycleActionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.lifecycleActionResult)) {
    query['LifecycleActionResult'] = request.lifecycleActionResult;
  }
  if (!Util.isUnset(request.lifecycleActionToken)) {
    query['LifecycleActionToken'] = request.lifecycleActionToken;
  }
  if (!Util.isUnset(request.lifecycleHookId)) {
    query['LifecycleHookId'] = request.lifecycleHookId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CompleteLifecycleAction',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function completeLifecycleAction(request: CompleteLifecycleActionRequest): CompleteLifecycleActionResponse {
  var runtime = new Util.RuntimeOptions{};
  return completeLifecycleActionWithOptions(request, runtime);
}

model CreateAlarmRequest {
  alarmAction?: [ string ](name='AlarmAction'),
  comparisonOperator?: string(name='ComparisonOperator'),
  description?: string(name='Description'),
  dimension?: [ 
    {
      dimensionKey?: string(name='DimensionKey'),
      dimensionValue?: string(name='DimensionValue'),
    }
  ](name='Dimension'),
  effective?: string(name='Effective'),
  evaluationCount?: int32(name='EvaluationCount'),
  expression?: [ 
    {
      comparisonOperator?: string(name='ComparisonOperator'),
      metricName?: string(name='MetricName'),
      period?: int32(name='Period'),
      statistics?: string(name='Statistics'),
      threshold?: float(name='Threshold'),
    }
  ](name='Expression'),
  expressionsLogicOperator?: string(name='ExpressionsLogicOperator'),
  groupId?: int32(name='GroupId'),
  metricName?: string(name='MetricName'),
  metricType?: string(name='MetricType'),
  name?: string(name='Name'),
  ownerId?: long(name='OwnerId'),
  period?: int32(name='Period'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
  statistics?: string(name='Statistics'),
  threshold?: float(name='Threshold'),
}

model CreateAlarmResponseBody = {
  alarmTaskId?: string(name='AlarmTaskId'),
  requestId?: string(name='RequestId'),
}

model CreateAlarmResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAlarmResponseBody(name='body'),
}

async function createAlarmWithOptions(request: CreateAlarmRequest, runtime: Util.RuntimeOptions): CreateAlarmResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.alarmAction)) {
    query['AlarmAction'] = request.alarmAction;
  }
  if (!Util.isUnset(request.comparisonOperator)) {
    query['ComparisonOperator'] = request.comparisonOperator;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.dimension)) {
    query['Dimension'] = request.dimension;
  }
  if (!Util.isUnset(request.effective)) {
    query['Effective'] = request.effective;
  }
  if (!Util.isUnset(request.evaluationCount)) {
    query['EvaluationCount'] = request.evaluationCount;
  }
  if (!Util.isUnset(request.expression)) {
    query['Expression'] = request.expression;
  }
  if (!Util.isUnset(request.expressionsLogicOperator)) {
    query['ExpressionsLogicOperator'] = request.expressionsLogicOperator;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.metricType)) {
    query['MetricType'] = request.metricType;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  if (!Util.isUnset(request.statistics)) {
    query['Statistics'] = request.statistics;
  }
  if (!Util.isUnset(request.threshold)) {
    query['Threshold'] = request.threshold;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAlarm',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAlarm(request: CreateAlarmRequest): CreateAlarmResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAlarmWithOptions(request, runtime);
}

model CreateEciScalingConfigurationRequest {
  acrRegistryInfo?: [ 
    {
      domain?: [ string ](name='Domain'),
      instanceId?: string(name='InstanceId'),
      instanceName?: string(name='InstanceName'),
      regionId?: string(name='RegionId'),
    }
  ](name='AcrRegistryInfo'),
  activeDeadlineSeconds?: long(name='ActiveDeadlineSeconds'),
  autoCreateEip?: boolean(name='AutoCreateEip'),
  autoMatchImageCache?: boolean(name='AutoMatchImageCache'),
  container?: [ 
    {
      livenessProbe: {
        exec: {
            command?: [ string ](name='Command'),
        }(name='Exec'),
        failureThreshold?: int32(name='FailureThreshold'),
        httpGet: {
            path?: string(name='Path'),
            port?: int32(name='Port'),
            scheme?: string(name='Scheme'),
        }(name='HttpGet'),
        initialDelaySeconds?: int32(name='InitialDelaySeconds'),
        periodSeconds?: int32(name='PeriodSeconds'),
        successThreshold?: int32(name='SuccessThreshold'),
        tcpSocket: {
            port?: int32(name='Port'),
        }(name='TcpSocket'),
        timeoutSeconds?: int32(name='TimeoutSeconds'),
      }(name='LivenessProbe'),
      readinessProbe: {
        exec: {
            command?: [ string ](name='Command'),
        }(name='Exec'),
        failureThreshold?: int32(name='FailureThreshold'),
        httpGet: {
            path?: string(name='Path'),
            port?: int32(name='Port'),
            scheme?: string(name='Scheme'),
        }(name='HttpGet'),
        initialDelaySeconds?: int32(name='InitialDelaySeconds'),
        periodSeconds?: int32(name='PeriodSeconds'),
        successThreshold?: int32(name='SuccessThreshold'),
        tcpSocket: {
            port?: int32(name='Port'),
        }(name='TcpSocket'),
        timeoutSeconds?: int32(name='TimeoutSeconds'),
      }(name='ReadinessProbe'),
      securityContext: {
        capability: {
            add?: [ string ](name='Add'),
        }(name='Capability'),
        readOnlyRootFilesystem?: boolean(name='ReadOnlyRootFilesystem'),
        runAsUser?: long(name='RunAsUser'),
      }(name='SecurityContext'),
      arg?: [ string ](name='Arg'),
      command?: [ string ](name='Command'),
      cpu?: float(name='Cpu'),
      environmentVar?: [ 
        {
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='EnvironmentVar'),
      gpu?: int32(name='Gpu'),
      image?: string(name='Image'),
      imagePullPolicy?: string(name='ImagePullPolicy'),
      memory?: float(name='Memory'),
      name?: string(name='Name'),
      port?: [ 
        {
          port?: int32(name='Port'),
          protocol?: string(name='Protocol'),
        }
      ](name='Port'),
      stdin?: boolean(name='Stdin'),
      stdinOnce?: boolean(name='StdinOnce'),
      tty?: boolean(name='Tty'),
      volumeMount?: [ 
        {
          mountPath?: string(name='MountPath'),
          mountPropagation?: string(name='MountPropagation'),
          name?: string(name='Name'),
          readOnly?: boolean(name='ReadOnly'),
          subPath?: string(name='SubPath'),
        }
      ](name='VolumeMount'),
      workingDir?: string(name='WorkingDir'),
    }
  ](name='Container'),
  containerGroupName?: string(name='ContainerGroupName'),
  costOptimization?: boolean(name='CostOptimization'),
  cpu?: float(name='Cpu'),
  cpuOptionsCore?: int32(name='CpuOptionsCore'),
  cpuOptionsThreadsPerCore?: int32(name='CpuOptionsThreadsPerCore'),
  dnsConfigNameServer?: [ string ](name='DnsConfigNameServer'),
  dnsConfigOption?: [ 
    {
      name?: string(name='Name'),
      value?: string(name='Value'),
    }
  ](name='DnsConfigOption'),
  dnsConfigSearch?: [ string ](name='DnsConfigSearch'),
  dnsPolicy?: string(name='DnsPolicy'),
  egressBandwidth?: long(name='EgressBandwidth'),
  eipBandwidth?: int32(name='EipBandwidth'),
  ephemeralStorage?: int32(name='EphemeralStorage'),
  hostAliase?: [ 
    {
      hostname?: [ string ](name='Hostname'),
      ip?: string(name='Ip'),
    }
  ](name='HostAliase'),
  hostName?: string(name='HostName'),
  imageRegistryCredential?: [ 
    {
      password?: string(name='Password'),
      server?: string(name='Server'),
      userName?: string(name='UserName'),
    }
  ](name='ImageRegistryCredential'),
  imageSnapshotId?: string(name='ImageSnapshotId'),
  ingressBandwidth?: long(name='IngressBandwidth'),
  initContainer?: [ 
    {
      securityContext: {
        capability: {
            add?: [ string ](name='Add'),
        }(name='Capability'),
        readOnlyRootFilesystem?: boolean(name='ReadOnlyRootFilesystem'),
        runAsUser?: long(name='RunAsUser'),
      }(name='SecurityContext'),
      arg?: [ string ](name='Arg'),
      command?: [ string ](name='Command'),
      cpu?: float(name='Cpu'),
      gpu?: int32(name='Gpu'),
      image?: string(name='Image'),
      imagePullPolicy?: string(name='ImagePullPolicy'),
      initContainerEnvironmentVar?: [ 
        {
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='InitContainerEnvironmentVar'),
      initContainerVolumeMount?: [ 
        {
          mountPath?: string(name='MountPath'),
          mountPropagation?: string(name='MountPropagation'),
          name?: string(name='Name'),
          readOnly?: boolean(name='ReadOnly'),
          subPath?: string(name='SubPath'),
        }
      ](name='InitContainerVolumeMount'),
      memory?: float(name='Memory'),
      name?: string(name='Name'),
      workingDir?: string(name='WorkingDir'),
    }
  ](name='InitContainer'),
  instanceFamilyLevel?: string(name='InstanceFamilyLevel'),
  ipv6AddressCount?: int32(name='Ipv6AddressCount'),
  loadBalancerWeight?: int32(name='LoadBalancerWeight'),
  memory?: float(name='Memory'),
  ntpServer?: [ string ](name='NtpServer'),
  ownerId?: long(name='OwnerId'),
  ramRoleName?: string(name='RamRoleName'),
  resourceGroupId?: string(name='ResourceGroupId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  restartPolicy?: string(name='RestartPolicy'),
  scalingConfigurationName?: string(name='ScalingConfigurationName'),
  scalingGroupId?: string(name='ScalingGroupId'),
  securityContextSysctl?: [ 
    {
      name?: string(name='Name'),
      value?: string(name='Value'),
    }
  ](name='SecurityContextSysctl'),
  securityGroupId?: string(name='SecurityGroupId'),
  spotPriceLimit?: float(name='SpotPriceLimit'),
  spotStrategy?: string(name='SpotStrategy'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
  terminationGracePeriodSeconds?: long(name='TerminationGracePeriodSeconds'),
  volume?: [ 
    {
      diskVolume: {
        diskId?: string(name='DiskId'),
        diskSize?: int32(name='DiskSize'),
        fsType?: string(name='FsType'),
      }(name='DiskVolume'),
      emptyDirVolume: {
        medium?: string(name='Medium'),
      }(name='EmptyDirVolume'),
      flexVolume: {
        driver?: string(name='Driver'),
        fsType?: string(name='FsType'),
        options?: string(name='Options'),
      }(name='FlexVolume'),
      hostPathVolume: {
        path?: string(name='Path'),
        type?: string(name='Type'),
      }(name='HostPathVolume'),
      NFSVolume: {
        path?: string(name='Path'),
        readOnly?: boolean(name='ReadOnly'),
        server?: string(name='Server'),
      }(name='NFSVolume'),
      configFileVolumeConfigFileToPath?: [ 
        {
          content?: string(name='Content'),
          mode?: int32(name='Mode'),
          path?: string(name='Path'),
        }
      ](name='ConfigFileVolumeConfigFileToPath'),
      configFileVolumeDefaultMode?: int32(name='ConfigFileVolumeDefaultMode'),
      name?: string(name='Name'),
      type?: string(name='Type'),
    }
  ](name='Volume'),
}

model CreateEciScalingConfigurationResponseBody = {
  requestId?: string(name='RequestId'),
  scalingConfigurationId?: string(name='ScalingConfigurationId'),
}

model CreateEciScalingConfigurationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateEciScalingConfigurationResponseBody(name='body'),
}

async function createEciScalingConfigurationWithOptions(request: CreateEciScalingConfigurationRequest, runtime: Util.RuntimeOptions): CreateEciScalingConfigurationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acrRegistryInfo)) {
    query['AcrRegistryInfo'] = request.acrRegistryInfo;
  }
  if (!Util.isUnset(request.activeDeadlineSeconds)) {
    query['ActiveDeadlineSeconds'] = request.activeDeadlineSeconds;
  }
  if (!Util.isUnset(request.autoCreateEip)) {
    query['AutoCreateEip'] = request.autoCreateEip;
  }
  if (!Util.isUnset(request.autoMatchImageCache)) {
    query['AutoMatchImageCache'] = request.autoMatchImageCache;
  }
  if (!Util.isUnset(request.container)) {
    query['Container'] = request.container;
  }
  if (!Util.isUnset(request.containerGroupName)) {
    query['ContainerGroupName'] = request.containerGroupName;
  }
  if (!Util.isUnset(request.costOptimization)) {
    query['CostOptimization'] = request.costOptimization;
  }
  if (!Util.isUnset(request.cpu)) {
    query['Cpu'] = request.cpu;
  }
  if (!Util.isUnset(request.cpuOptionsCore)) {
    query['CpuOptionsCore'] = request.cpuOptionsCore;
  }
  if (!Util.isUnset(request.cpuOptionsThreadsPerCore)) {
    query['CpuOptionsThreadsPerCore'] = request.cpuOptionsThreadsPerCore;
  }
  if (!Util.isUnset(request.dnsConfigNameServer)) {
    query['DnsConfigNameServer'] = request.dnsConfigNameServer;
  }
  if (!Util.isUnset(request.dnsConfigOption)) {
    query['DnsConfigOption'] = request.dnsConfigOption;
  }
  if (!Util.isUnset(request.dnsConfigSearch)) {
    query['DnsConfigSearch'] = request.dnsConfigSearch;
  }
  if (!Util.isUnset(request.dnsPolicy)) {
    query['DnsPolicy'] = request.dnsPolicy;
  }
  if (!Util.isUnset(request.egressBandwidth)) {
    query['EgressBandwidth'] = request.egressBandwidth;
  }
  if (!Util.isUnset(request.eipBandwidth)) {
    query['EipBandwidth'] = request.eipBandwidth;
  }
  if (!Util.isUnset(request.ephemeralStorage)) {
    query['EphemeralStorage'] = request.ephemeralStorage;
  }
  if (!Util.isUnset(request.hostAliase)) {
    query['HostAliase'] = request.hostAliase;
  }
  if (!Util.isUnset(request.hostName)) {
    query['HostName'] = request.hostName;
  }
  if (!Util.isUnset(request.imageRegistryCredential)) {
    query['ImageRegistryCredential'] = request.imageRegistryCredential;
  }
  if (!Util.isUnset(request.imageSnapshotId)) {
    query['ImageSnapshotId'] = request.imageSnapshotId;
  }
  if (!Util.isUnset(request.ingressBandwidth)) {
    query['IngressBandwidth'] = request.ingressBandwidth;
  }
  if (!Util.isUnset(request.initContainer)) {
    query['InitContainer'] = request.initContainer;
  }
  if (!Util.isUnset(request.instanceFamilyLevel)) {
    query['InstanceFamilyLevel'] = request.instanceFamilyLevel;
  }
  if (!Util.isUnset(request.ipv6AddressCount)) {
    query['Ipv6AddressCount'] = request.ipv6AddressCount;
  }
  if (!Util.isUnset(request.loadBalancerWeight)) {
    query['LoadBalancerWeight'] = request.loadBalancerWeight;
  }
  if (!Util.isUnset(request.memory)) {
    query['Memory'] = request.memory;
  }
  if (!Util.isUnset(request.ntpServer)) {
    query['NtpServer'] = request.ntpServer;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.ramRoleName)) {
    query['RamRoleName'] = request.ramRoleName;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.restartPolicy)) {
    query['RestartPolicy'] = request.restartPolicy;
  }
  if (!Util.isUnset(request.scalingConfigurationName)) {
    query['ScalingConfigurationName'] = request.scalingConfigurationName;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  if (!Util.isUnset(request.securityContextSysctl)) {
    query['SecurityContextSysctl'] = request.securityContextSysctl;
  }
  if (!Util.isUnset(request.securityGroupId)) {
    query['SecurityGroupId'] = request.securityGroupId;
  }
  if (!Util.isUnset(request.spotPriceLimit)) {
    query['SpotPriceLimit'] = request.spotPriceLimit;
  }
  if (!Util.isUnset(request.spotStrategy)) {
    query['SpotStrategy'] = request.spotStrategy;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!Util.isUnset(request.terminationGracePeriodSeconds)) {
    query['TerminationGracePeriodSeconds'] = request.terminationGracePeriodSeconds;
  }
  if (!Util.isUnset(request.volume)) {
    query['Volume'] = request.volume;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateEciScalingConfiguration',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createEciScalingConfiguration(request: CreateEciScalingConfigurationRequest): CreateEciScalingConfigurationResponse {
  var runtime = new Util.RuntimeOptions{};
  return createEciScalingConfigurationWithOptions(request, runtime);
}

model CreateLifecycleHookRequest {
  defaultResult?: string(name='DefaultResult'),
  heartbeatTimeout?: int32(name='HeartbeatTimeout'),
  lifecycleHookName?: string(name='LifecycleHookName'),
  lifecycleTransition?: string(name='LifecycleTransition'),
  notificationArn?: string(name='NotificationArn'),
  notificationMetadata?: string(name='NotificationMetadata'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model CreateLifecycleHookResponseBody = {
  lifecycleHookId?: string(name='LifecycleHookId'),
  requestId?: string(name='RequestId'),
}

model CreateLifecycleHookResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateLifecycleHookResponseBody(name='body'),
}

async function createLifecycleHookWithOptions(request: CreateLifecycleHookRequest, runtime: Util.RuntimeOptions): CreateLifecycleHookResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.defaultResult)) {
    query['DefaultResult'] = request.defaultResult;
  }
  if (!Util.isUnset(request.heartbeatTimeout)) {
    query['HeartbeatTimeout'] = request.heartbeatTimeout;
  }
  if (!Util.isUnset(request.lifecycleHookName)) {
    query['LifecycleHookName'] = request.lifecycleHookName;
  }
  if (!Util.isUnset(request.lifecycleTransition)) {
    query['LifecycleTransition'] = request.lifecycleTransition;
  }
  if (!Util.isUnset(request.notificationArn)) {
    query['NotificationArn'] = request.notificationArn;
  }
  if (!Util.isUnset(request.notificationMetadata)) {
    query['NotificationMetadata'] = request.notificationMetadata;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateLifecycleHook',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createLifecycleHook(request: CreateLifecycleHookRequest): CreateLifecycleHookResponse {
  var runtime = new Util.RuntimeOptions{};
  return createLifecycleHookWithOptions(request, runtime);
}

model CreateNotificationConfigurationRequest {
  notificationArn?: string(name='NotificationArn'),
  notificationType?: [ string ](name='NotificationType'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model CreateNotificationConfigurationResponseBody = {
  requestId?: string(name='RequestId'),
}

model CreateNotificationConfigurationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateNotificationConfigurationResponseBody(name='body'),
}

async function createNotificationConfigurationWithOptions(request: CreateNotificationConfigurationRequest, runtime: Util.RuntimeOptions): CreateNotificationConfigurationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.notificationArn)) {
    query['NotificationArn'] = request.notificationArn;
  }
  if (!Util.isUnset(request.notificationType)) {
    query['NotificationType'] = request.notificationType;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateNotificationConfiguration',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createNotificationConfiguration(request: CreateNotificationConfigurationRequest): CreateNotificationConfigurationResponse {
  var runtime = new Util.RuntimeOptions{};
  return createNotificationConfigurationWithOptions(request, runtime);
}

model CreateScalingConfigurationRequest {
  privatePoolOptions?: {
    id?: string(name='Id'),
    matchCriteria?: string(name='MatchCriteria'),
  }(name='PrivatePoolOptions'),
  systemDisk?: {
    autoSnapshotPolicyId?: string(name='AutoSnapshotPolicyId'),
    burstingEnabled?: boolean(name='BurstingEnabled'),
    category?: string(name='Category'),
    description?: string(name='Description'),
    diskName?: string(name='DiskName'),
    encryptAlgorithm?: string(name='EncryptAlgorithm'),
    encrypted?: boolean(name='Encrypted'),
    KMSKeyId?: string(name='KMSKeyId'),
    performanceLevel?: string(name='PerformanceLevel'),
    provisionedIops?: long(name='ProvisionedIops'),
    size?: int32(name='Size'),
  }(name='SystemDisk'),
  affinity?: string(name='Affinity'),
  clientToken?: string(name='ClientToken'),
  cpu?: int32(name='Cpu'),
  creditSpecification?: string(name='CreditSpecification'),
  dataDisk?: [ 
    {
      autoSnapshotPolicyId?: string(name='AutoSnapshotPolicyId'),
      burstingEnabled?: boolean(name='BurstingEnabled'),
      categories?: [ string ](name='Categories'),
      category?: string(name='Category'),
      deleteWithInstance?: boolean(name='DeleteWithInstance'),
      description?: string(name='Description'),
      device?: string(name='Device'),
      diskName?: string(name='DiskName'),
      encrypted?: string(name='Encrypted'),
      KMSKeyId?: string(name='KMSKeyId'),
      performanceLevel?: string(name='PerformanceLevel'),
      provisionedIops?: long(name='ProvisionedIops'),
      size?: int32(name='Size'),
      snapshotId?: string(name='SnapshotId'),
    }
  ](name='DataDisk'),
  dedicatedHostId?: string(name='DedicatedHostId'),
  deploymentSetId?: string(name='DeploymentSetId'),
  hostName?: string(name='HostName'),
  hpcClusterId?: string(name='HpcClusterId'),
  imageFamily?: string(name='ImageFamily'),
  imageId?: string(name='ImageId'),
  imageName?: string(name='ImageName'),
  instanceDescription?: string(name='InstanceDescription'),
  instanceName?: string(name='InstanceName'),
  instancePatternInfo?: [ 
    {
      architecture?: [ string ](name='Architecture'),
      burstablePerformance?: string(name='BurstablePerformance'),
      cores?: int32(name='Cores'),
      excludedInstanceType?: [ string ](name='ExcludedInstanceType'),
      instanceFamilyLevel?: string(name='InstanceFamilyLevel'),
      maxPrice?: float(name='MaxPrice'),
      memory?: float(name='Memory'),
    }
  ](name='InstancePatternInfo'),
  instanceType?: string(name='InstanceType'),
  instanceTypeOverride?: [ 
    {
      instanceType?: string(name='InstanceType'),
      weightedCapacity?: int32(name='WeightedCapacity'),
    }
  ](name='InstanceTypeOverride'),
  instanceTypes?: [ string ](name='InstanceTypes'),
  internetChargeType?: string(name='InternetChargeType'),
  internetMaxBandwidthIn?: int32(name='InternetMaxBandwidthIn'),
  internetMaxBandwidthOut?: int32(name='InternetMaxBandwidthOut'),
  ioOptimized?: string(name='IoOptimized'),
  ipv6AddressCount?: int32(name='Ipv6AddressCount'),
  keyPairName?: string(name='KeyPairName'),
  loadBalancerWeight?: int32(name='LoadBalancerWeight'),
  memory?: int32(name='Memory'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  password?: string(name='Password'),
  passwordInherit?: boolean(name='PasswordInherit'),
  ramRoleName?: string(name='RamRoleName'),
  resourceGroupId?: string(name='ResourceGroupId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingConfigurationName?: string(name='ScalingConfigurationName'),
  scalingGroupId?: string(name='ScalingGroupId'),
  schedulerOptions?: map[string]any(name='SchedulerOptions'),
  securityEnhancementStrategy?: string(name='SecurityEnhancementStrategy'),
  securityGroupId?: string(name='SecurityGroupId'),
  securityGroupIds?: [ string ](name='SecurityGroupIds'),
  spotDuration?: int32(name='SpotDuration'),
  spotInterruptionBehavior?: string(name='SpotInterruptionBehavior'),
  spotPriceLimit?: [ 
    {
      instanceType?: string(name='InstanceType'),
      priceLimit?: float(name='PriceLimit'),
    }
  ](name='SpotPriceLimit'),
  spotStrategy?: string(name='SpotStrategy'),
  systemDiskCategories?: [ string ](name='SystemDiskCategories'),
  tags?: string(name='Tags'),
  tenancy?: string(name='Tenancy'),
  userData?: string(name='UserData'),
  zoneId?: string(name='ZoneId'),
}

model CreateScalingConfigurationShrinkRequest {
  privatePoolOptions?: {
    id?: string(name='Id'),
    matchCriteria?: string(name='MatchCriteria'),
  }(name='PrivatePoolOptions'),
  systemDisk?: {
    autoSnapshotPolicyId?: string(name='AutoSnapshotPolicyId'),
    burstingEnabled?: boolean(name='BurstingEnabled'),
    category?: string(name='Category'),
    description?: string(name='Description'),
    diskName?: string(name='DiskName'),
    encryptAlgorithm?: string(name='EncryptAlgorithm'),
    encrypted?: boolean(name='Encrypted'),
    KMSKeyId?: string(name='KMSKeyId'),
    performanceLevel?: string(name='PerformanceLevel'),
    provisionedIops?: long(name='ProvisionedIops'),
    size?: int32(name='Size'),
  }(name='SystemDisk'),
  affinity?: string(name='Affinity'),
  clientToken?: string(name='ClientToken'),
  cpu?: int32(name='Cpu'),
  creditSpecification?: string(name='CreditSpecification'),
  dataDisk?: [ 
    {
      autoSnapshotPolicyId?: string(name='AutoSnapshotPolicyId'),
      burstingEnabled?: boolean(name='BurstingEnabled'),
      categories?: [ string ](name='Categories'),
      category?: string(name='Category'),
      deleteWithInstance?: boolean(name='DeleteWithInstance'),
      description?: string(name='Description'),
      device?: string(name='Device'),
      diskName?: string(name='DiskName'),
      encrypted?: string(name='Encrypted'),
      KMSKeyId?: string(name='KMSKeyId'),
      performanceLevel?: string(name='PerformanceLevel'),
      provisionedIops?: long(name='ProvisionedIops'),
      size?: int32(name='Size'),
      snapshotId?: string(name='SnapshotId'),
    }
  ](name='DataDisk'),
  dedicatedHostId?: string(name='DedicatedHostId'),
  deploymentSetId?: string(name='DeploymentSetId'),
  hostName?: string(name='HostName'),
  hpcClusterId?: string(name='HpcClusterId'),
  imageFamily?: string(name='ImageFamily'),
  imageId?: string(name='ImageId'),
  imageName?: string(name='ImageName'),
  instanceDescription?: string(name='InstanceDescription'),
  instanceName?: string(name='InstanceName'),
  instancePatternInfo?: [ 
    {
      architecture?: [ string ](name='Architecture'),
      burstablePerformance?: string(name='BurstablePerformance'),
      cores?: int32(name='Cores'),
      excludedInstanceType?: [ string ](name='ExcludedInstanceType'),
      instanceFamilyLevel?: string(name='InstanceFamilyLevel'),
      maxPrice?: float(name='MaxPrice'),
      memory?: float(name='Memory'),
    }
  ](name='InstancePatternInfo'),
  instanceType?: string(name='InstanceType'),
  instanceTypeOverride?: [ 
    {
      instanceType?: string(name='InstanceType'),
      weightedCapacity?: int32(name='WeightedCapacity'),
    }
  ](name='InstanceTypeOverride'),
  instanceTypes?: [ string ](name='InstanceTypes'),
  internetChargeType?: string(name='InternetChargeType'),
  internetMaxBandwidthIn?: int32(name='InternetMaxBandwidthIn'),
  internetMaxBandwidthOut?: int32(name='InternetMaxBandwidthOut'),
  ioOptimized?: string(name='IoOptimized'),
  ipv6AddressCount?: int32(name='Ipv6AddressCount'),
  keyPairName?: string(name='KeyPairName'),
  loadBalancerWeight?: int32(name='LoadBalancerWeight'),
  memory?: int32(name='Memory'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  password?: string(name='Password'),
  passwordInherit?: boolean(name='PasswordInherit'),
  ramRoleName?: string(name='RamRoleName'),
  resourceGroupId?: string(name='ResourceGroupId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingConfigurationName?: string(name='ScalingConfigurationName'),
  scalingGroupId?: string(name='ScalingGroupId'),
  schedulerOptionsShrink?: string(name='SchedulerOptions'),
  securityEnhancementStrategy?: string(name='SecurityEnhancementStrategy'),
  securityGroupId?: string(name='SecurityGroupId'),
  securityGroupIds?: [ string ](name='SecurityGroupIds'),
  spotDuration?: int32(name='SpotDuration'),
  spotInterruptionBehavior?: string(name='SpotInterruptionBehavior'),
  spotPriceLimit?: [ 
    {
      instanceType?: string(name='InstanceType'),
      priceLimit?: float(name='PriceLimit'),
    }
  ](name='SpotPriceLimit'),
  spotStrategy?: string(name='SpotStrategy'),
  systemDiskCategories?: [ string ](name='SystemDiskCategories'),
  tags?: string(name='Tags'),
  tenancy?: string(name='Tenancy'),
  userData?: string(name='UserData'),
  zoneId?: string(name='ZoneId'),
}

model CreateScalingConfigurationResponseBody = {
  requestId?: string(name='RequestId'),
  scalingConfigurationId?: string(name='ScalingConfigurationId'),
}

model CreateScalingConfigurationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateScalingConfigurationResponseBody(name='body'),
}

async function createScalingConfigurationWithOptions(tmpReq: CreateScalingConfigurationRequest, runtime: Util.RuntimeOptions): CreateScalingConfigurationResponse {
  Util.validateModel(tmpReq);
  var request = new CreateScalingConfigurationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.schedulerOptions)) {
    request.schedulerOptionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.schedulerOptions, 'SchedulerOptions', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.affinity)) {
    query['Affinity'] = request.affinity;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.cpu)) {
    query['Cpu'] = request.cpu;
  }
  if (!Util.isUnset(request.creditSpecification)) {
    query['CreditSpecification'] = request.creditSpecification;
  }
  if (!Util.isUnset(request.dataDisk)) {
    query['DataDisk'] = request.dataDisk;
  }
  if (!Util.isUnset(request.dedicatedHostId)) {
    query['DedicatedHostId'] = request.dedicatedHostId;
  }
  if (!Util.isUnset(request.deploymentSetId)) {
    query['DeploymentSetId'] = request.deploymentSetId;
  }
  if (!Util.isUnset(request.hostName)) {
    query['HostName'] = request.hostName;
  }
  if (!Util.isUnset(request.hpcClusterId)) {
    query['HpcClusterId'] = request.hpcClusterId;
  }
  if (!Util.isUnset(request.imageFamily)) {
    query['ImageFamily'] = request.imageFamily;
  }
  if (!Util.isUnset(request.imageId)) {
    query['ImageId'] = request.imageId;
  }
  if (!Util.isUnset(request.imageName)) {
    query['ImageName'] = request.imageName;
  }
  if (!Util.isUnset(request.instanceDescription)) {
    query['InstanceDescription'] = request.instanceDescription;
  }
  if (!Util.isUnset(request.instanceName)) {
    query['InstanceName'] = request.instanceName;
  }
  if (!Util.isUnset(request.instancePatternInfo)) {
    query['InstancePatternInfo'] = request.instancePatternInfo;
  }
  if (!Util.isUnset(request.instanceType)) {
    query['InstanceType'] = request.instanceType;
  }
  if (!Util.isUnset(request.instanceTypeOverride)) {
    query['InstanceTypeOverride'] = request.instanceTypeOverride;
  }
  if (!Util.isUnset(request.instanceTypes)) {
    query['InstanceTypes'] = request.instanceTypes;
  }
  if (!Util.isUnset(request.internetChargeType)) {
    query['InternetChargeType'] = request.internetChargeType;
  }
  if (!Util.isUnset(request.internetMaxBandwidthIn)) {
    query['InternetMaxBandwidthIn'] = request.internetMaxBandwidthIn;
  }
  if (!Util.isUnset(request.internetMaxBandwidthOut)) {
    query['InternetMaxBandwidthOut'] = request.internetMaxBandwidthOut;
  }
  if (!Util.isUnset(request.ioOptimized)) {
    query['IoOptimized'] = request.ioOptimized;
  }
  if (!Util.isUnset(request.ipv6AddressCount)) {
    query['Ipv6AddressCount'] = request.ipv6AddressCount;
  }
  if (!Util.isUnset(request.keyPairName)) {
    query['KeyPairName'] = request.keyPairName;
  }
  if (!Util.isUnset(request.loadBalancerWeight)) {
    query['LoadBalancerWeight'] = request.loadBalancerWeight;
  }
  if (!Util.isUnset(request.memory)) {
    query['Memory'] = request.memory;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.password)) {
    query['Password'] = request.password;
  }
  if (!Util.isUnset(request.passwordInherit)) {
    query['PasswordInherit'] = request.passwordInherit;
  }
  if (!Util.isUnset(request.ramRoleName)) {
    query['RamRoleName'] = request.ramRoleName;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingConfigurationName)) {
    query['ScalingConfigurationName'] = request.scalingConfigurationName;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  if (!Util.isUnset(request.schedulerOptionsShrink)) {
    query['SchedulerOptions'] = request.schedulerOptionsShrink;
  }
  if (!Util.isUnset(request.securityEnhancementStrategy)) {
    query['SecurityEnhancementStrategy'] = request.securityEnhancementStrategy;
  }
  if (!Util.isUnset(request.securityGroupId)) {
    query['SecurityGroupId'] = request.securityGroupId;
  }
  if (!Util.isUnset(request.securityGroupIds)) {
    query['SecurityGroupIds'] = request.securityGroupIds;
  }
  if (!Util.isUnset(request.spotDuration)) {
    query['SpotDuration'] = request.spotDuration;
  }
  if (!Util.isUnset(request.spotInterruptionBehavior)) {
    query['SpotInterruptionBehavior'] = request.spotInterruptionBehavior;
  }
  if (!Util.isUnset(request.spotPriceLimit)) {
    query['SpotPriceLimit'] = request.spotPriceLimit;
  }
  if (!Util.isUnset(request.spotStrategy)) {
    query['SpotStrategy'] = request.spotStrategy;
  }
  if (!Util.isUnset(request.systemDiskCategories)) {
    query['SystemDiskCategories'] = request.systemDiskCategories;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!Util.isUnset(request.tenancy)) {
    query['Tenancy'] = request.tenancy;
  }
  if (!Util.isUnset(request.userData)) {
    query['UserData'] = request.userData;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  if (!Util.isUnset(request.privatePoolOptions)) {
    query['PrivatePoolOptions'] = request.privatePoolOptions;
  }
  if (!Util.isUnset(request.systemDisk)) {
    query['SystemDisk'] = request.systemDisk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateScalingConfiguration',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createScalingConfiguration(request: CreateScalingConfigurationRequest): CreateScalingConfigurationResponse {
  var runtime = new Util.RuntimeOptions{};
  return createScalingConfigurationWithOptions(request, runtime);
}

model CreateScalingGroupRequest {
  removalPolicy?: [ string ](name='RemovalPolicy'),
  albServerGroup?: [ 
    {
      albServerGroupId?: string(name='AlbServerGroupId'),
      port?: int32(name='Port'),
      weight?: int32(name='Weight'),
    }
  ](name='AlbServerGroup'),
  allocationStrategy?: string(name='AllocationStrategy'),
  azBalance?: boolean(name='AzBalance'),
  clientToken?: string(name='ClientToken'),
  compensateWithOnDemand?: boolean(name='CompensateWithOnDemand'),
  containerGroupId?: string(name='ContainerGroupId'),
  DBInstanceIds?: string(name='DBInstanceIds'),
  defaultCooldown?: int32(name='DefaultCooldown'),
  desiredCapacity?: int32(name='DesiredCapacity'),
  groupDeletionProtection?: boolean(name='GroupDeletionProtection'),
  groupType?: string(name='GroupType'),
  healthCheckType?: string(name='HealthCheckType'),
  instanceId?: string(name='InstanceId'),
  launchTemplateId?: string(name='LaunchTemplateId'),
  launchTemplateOverride?: [ 
    {
      instanceType?: string(name='InstanceType'),
      weightedCapacity?: int32(name='WeightedCapacity'),
    }
  ](name='LaunchTemplateOverride'),
  launchTemplateVersion?: string(name='LaunchTemplateVersion'),
  lifecycleHook?: [ 
    {
      defaultResult?: string(name='DefaultResult'),
      heartbeatTimeout?: int32(name='HeartbeatTimeout'),
      lifecycleHookName?: string(name='LifecycleHookName'),
      lifecycleTransition?: string(name='LifecycleTransition'),
      notificationArn?: string(name='NotificationArn'),
      notificationMetadata?: string(name='NotificationMetadata'),
    }
  ](name='LifecycleHook'),
  loadBalancerIds?: string(name='LoadBalancerIds'),
  maxInstanceLifetime?: int32(name='MaxInstanceLifetime'),
  maxSize?: int32(name='MaxSize'),
  minSize?: int32(name='MinSize'),
  multiAZPolicy?: string(name='MultiAZPolicy'),
  onDemandBaseCapacity?: int32(name='OnDemandBaseCapacity'),
  onDemandPercentageAboveBaseCapacity?: int32(name='OnDemandPercentageAboveBaseCapacity'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupName?: string(name='ScalingGroupName'),
  scalingPolicy?: string(name='ScalingPolicy'),
  spotAllocationStrategy?: string(name='SpotAllocationStrategy'),
  spotInstancePools?: int32(name='SpotInstancePools'),
  spotInstanceRemedy?: boolean(name='SpotInstanceRemedy'),
  tag?: [ 
    {
      key?: string(name='Key'),
      propagate?: boolean(name='Propagate'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
  VServerGroup?: [ 
    {
      loadBalancerId?: string(name='LoadBalancerId'),
      VServerGroupAttribute?: [ 
        {
          port?: int32(name='Port'),
          VServerGroupId?: string(name='VServerGroupId'),
          weight?: int32(name='Weight'),
        }
      ](name='VServerGroupAttribute'),
    }
  ](name='VServerGroup'),
  vSwitchId?: string(name='VSwitchId'),
  vSwitchIds?: [ string ](name='VSwitchIds'),
}

model CreateScalingGroupResponseBody = {
  requestId?: string(name='RequestId'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model CreateScalingGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateScalingGroupResponseBody(name='body'),
}

async function createScalingGroupWithOptions(request: CreateScalingGroupRequest, runtime: Util.RuntimeOptions): CreateScalingGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.albServerGroup)) {
    query['AlbServerGroup'] = request.albServerGroup;
  }
  if (!Util.isUnset(request.allocationStrategy)) {
    query['AllocationStrategy'] = request.allocationStrategy;
  }
  if (!Util.isUnset(request.azBalance)) {
    query['AzBalance'] = request.azBalance;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.compensateWithOnDemand)) {
    query['CompensateWithOnDemand'] = request.compensateWithOnDemand;
  }
  if (!Util.isUnset(request.containerGroupId)) {
    query['ContainerGroupId'] = request.containerGroupId;
  }
  if (!Util.isUnset(request.DBInstanceIds)) {
    query['DBInstanceIds'] = request.DBInstanceIds;
  }
  if (!Util.isUnset(request.defaultCooldown)) {
    query['DefaultCooldown'] = request.defaultCooldown;
  }
  if (!Util.isUnset(request.desiredCapacity)) {
    query['DesiredCapacity'] = request.desiredCapacity;
  }
  if (!Util.isUnset(request.groupDeletionProtection)) {
    query['GroupDeletionProtection'] = request.groupDeletionProtection;
  }
  if (!Util.isUnset(request.groupType)) {
    query['GroupType'] = request.groupType;
  }
  if (!Util.isUnset(request.healthCheckType)) {
    query['HealthCheckType'] = request.healthCheckType;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.launchTemplateId)) {
    query['LaunchTemplateId'] = request.launchTemplateId;
  }
  if (!Util.isUnset(request.launchTemplateOverride)) {
    query['LaunchTemplateOverride'] = request.launchTemplateOverride;
  }
  if (!Util.isUnset(request.launchTemplateVersion)) {
    query['LaunchTemplateVersion'] = request.launchTemplateVersion;
  }
  if (!Util.isUnset(request.lifecycleHook)) {
    query['LifecycleHook'] = request.lifecycleHook;
  }
  if (!Util.isUnset(request.loadBalancerIds)) {
    query['LoadBalancerIds'] = request.loadBalancerIds;
  }
  if (!Util.isUnset(request.maxInstanceLifetime)) {
    query['MaxInstanceLifetime'] = request.maxInstanceLifetime;
  }
  if (!Util.isUnset(request.maxSize)) {
    query['MaxSize'] = request.maxSize;
  }
  if (!Util.isUnset(request.minSize)) {
    query['MinSize'] = request.minSize;
  }
  if (!Util.isUnset(request.multiAZPolicy)) {
    query['MultiAZPolicy'] = request.multiAZPolicy;
  }
  if (!Util.isUnset(request.onDemandBaseCapacity)) {
    query['OnDemandBaseCapacity'] = request.onDemandBaseCapacity;
  }
  if (!Util.isUnset(request.onDemandPercentageAboveBaseCapacity)) {
    query['OnDemandPercentageAboveBaseCapacity'] = request.onDemandPercentageAboveBaseCapacity;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupName)) {
    query['ScalingGroupName'] = request.scalingGroupName;
  }
  if (!Util.isUnset(request.scalingPolicy)) {
    query['ScalingPolicy'] = request.scalingPolicy;
  }
  if (!Util.isUnset(request.spotAllocationStrategy)) {
    query['SpotAllocationStrategy'] = request.spotAllocationStrategy;
  }
  if (!Util.isUnset(request.spotInstancePools)) {
    query['SpotInstancePools'] = request.spotInstancePools;
  }
  if (!Util.isUnset(request.spotInstanceRemedy)) {
    query['SpotInstanceRemedy'] = request.spotInstanceRemedy;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!Util.isUnset(request.VServerGroup)) {
    query['VServerGroup'] = request.VServerGroup;
  }
  if (!Util.isUnset(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!Util.isUnset(request.vSwitchIds)) {
    query['VSwitchIds'] = request.vSwitchIds;
  }
  if (!Util.isUnset(request.removalPolicy)) {
    query['RemovalPolicy'] = request.removalPolicy;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateScalingGroup',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createScalingGroup(request: CreateScalingGroupRequest): CreateScalingGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createScalingGroupWithOptions(request, runtime);
}

model CreateScalingRuleRequest {
  adjustmentType?: string(name='AdjustmentType'),
  adjustmentValue?: int32(name='AdjustmentValue'),
  cooldown?: int32(name='Cooldown'),
  disableScaleIn?: boolean(name='DisableScaleIn'),
  estimatedInstanceWarmup?: int32(name='EstimatedInstanceWarmup'),
  initialMaxSize?: int32(name='InitialMaxSize'),
  metricName?: string(name='MetricName'),
  minAdjustmentMagnitude?: int32(name='MinAdjustmentMagnitude'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  predictiveScalingMode?: string(name='PredictiveScalingMode'),
  predictiveTaskBufferTime?: int32(name='PredictiveTaskBufferTime'),
  predictiveValueBehavior?: string(name='PredictiveValueBehavior'),
  predictiveValueBuffer?: int32(name='PredictiveValueBuffer'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scaleInEvaluationCount?: int32(name='ScaleInEvaluationCount'),
  scaleOutEvaluationCount?: int32(name='ScaleOutEvaluationCount'),
  scalingGroupId?: string(name='ScalingGroupId'),
  scalingRuleName?: string(name='ScalingRuleName'),
  scalingRuleType?: string(name='ScalingRuleType'),
  stepAdjustment?: [ 
    {
      metricIntervalLowerBound?: float(name='MetricIntervalLowerBound'),
      metricIntervalUpperBound?: float(name='MetricIntervalUpperBound'),
      scalingAdjustment?: int32(name='ScalingAdjustment'),
    }
  ](name='StepAdjustment'),
  targetValue?: float(name='TargetValue'),
}

model CreateScalingRuleResponseBody = {
  requestId?: string(name='RequestId'),
  scalingRuleAri?: string(name='ScalingRuleAri'),
  scalingRuleId?: string(name='ScalingRuleId'),
}

model CreateScalingRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateScalingRuleResponseBody(name='body'),
}

async function createScalingRuleWithOptions(request: CreateScalingRuleRequest, runtime: Util.RuntimeOptions): CreateScalingRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.adjustmentType)) {
    query['AdjustmentType'] = request.adjustmentType;
  }
  if (!Util.isUnset(request.adjustmentValue)) {
    query['AdjustmentValue'] = request.adjustmentValue;
  }
  if (!Util.isUnset(request.cooldown)) {
    query['Cooldown'] = request.cooldown;
  }
  if (!Util.isUnset(request.disableScaleIn)) {
    query['DisableScaleIn'] = request.disableScaleIn;
  }
  if (!Util.isUnset(request.estimatedInstanceWarmup)) {
    query['EstimatedInstanceWarmup'] = request.estimatedInstanceWarmup;
  }
  if (!Util.isUnset(request.initialMaxSize)) {
    query['InitialMaxSize'] = request.initialMaxSize;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.minAdjustmentMagnitude)) {
    query['MinAdjustmentMagnitude'] = request.minAdjustmentMagnitude;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.predictiveScalingMode)) {
    query['PredictiveScalingMode'] = request.predictiveScalingMode;
  }
  if (!Util.isUnset(request.predictiveTaskBufferTime)) {
    query['PredictiveTaskBufferTime'] = request.predictiveTaskBufferTime;
  }
  if (!Util.isUnset(request.predictiveValueBehavior)) {
    query['PredictiveValueBehavior'] = request.predictiveValueBehavior;
  }
  if (!Util.isUnset(request.predictiveValueBuffer)) {
    query['PredictiveValueBuffer'] = request.predictiveValueBuffer;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scaleInEvaluationCount)) {
    query['ScaleInEvaluationCount'] = request.scaleInEvaluationCount;
  }
  if (!Util.isUnset(request.scaleOutEvaluationCount)) {
    query['ScaleOutEvaluationCount'] = request.scaleOutEvaluationCount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  if (!Util.isUnset(request.scalingRuleName)) {
    query['ScalingRuleName'] = request.scalingRuleName;
  }
  if (!Util.isUnset(request.scalingRuleType)) {
    query['ScalingRuleType'] = request.scalingRuleType;
  }
  if (!Util.isUnset(request.stepAdjustment)) {
    query['StepAdjustment'] = request.stepAdjustment;
  }
  if (!Util.isUnset(request.targetValue)) {
    query['TargetValue'] = request.targetValue;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateScalingRule',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createScalingRule(request: CreateScalingRuleRequest): CreateScalingRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createScalingRuleWithOptions(request, runtime);
}

model CreateScheduledTaskRequest {
  description?: string(name='Description'),
  desiredCapacity?: int32(name='DesiredCapacity'),
  launchExpirationTime?: int32(name='LaunchExpirationTime'),
  launchTime?: string(name='LaunchTime'),
  maxValue?: int32(name='MaxValue'),
  minValue?: int32(name='MinValue'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  recurrenceEndTime?: string(name='RecurrenceEndTime'),
  recurrenceType?: string(name='RecurrenceType'),
  recurrenceValue?: string(name='RecurrenceValue'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
  scheduledAction?: string(name='ScheduledAction'),
  scheduledTaskName?: string(name='ScheduledTaskName'),
  taskEnabled?: boolean(name='TaskEnabled'),
}

model CreateScheduledTaskResponseBody = {
  requestId?: string(name='RequestId'),
  scheduledTaskId?: string(name='ScheduledTaskId'),
}

model CreateScheduledTaskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateScheduledTaskResponseBody(name='body'),
}

async function createScheduledTaskWithOptions(request: CreateScheduledTaskRequest, runtime: Util.RuntimeOptions): CreateScheduledTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.desiredCapacity)) {
    query['DesiredCapacity'] = request.desiredCapacity;
  }
  if (!Util.isUnset(request.launchExpirationTime)) {
    query['LaunchExpirationTime'] = request.launchExpirationTime;
  }
  if (!Util.isUnset(request.launchTime)) {
    query['LaunchTime'] = request.launchTime;
  }
  if (!Util.isUnset(request.maxValue)) {
    query['MaxValue'] = request.maxValue;
  }
  if (!Util.isUnset(request.minValue)) {
    query['MinValue'] = request.minValue;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.recurrenceEndTime)) {
    query['RecurrenceEndTime'] = request.recurrenceEndTime;
  }
  if (!Util.isUnset(request.recurrenceType)) {
    query['RecurrenceType'] = request.recurrenceType;
  }
  if (!Util.isUnset(request.recurrenceValue)) {
    query['RecurrenceValue'] = request.recurrenceValue;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  if (!Util.isUnset(request.scheduledAction)) {
    query['ScheduledAction'] = request.scheduledAction;
  }
  if (!Util.isUnset(request.scheduledTaskName)) {
    query['ScheduledTaskName'] = request.scheduledTaskName;
  }
  if (!Util.isUnset(request.taskEnabled)) {
    query['TaskEnabled'] = request.taskEnabled;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateScheduledTask',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createScheduledTask(request: CreateScheduledTaskRequest): CreateScheduledTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createScheduledTaskWithOptions(request, runtime);
}

model DeactivateScalingConfigurationRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingConfigurationId?: string(name='ScalingConfigurationId'),
}

model DeactivateScalingConfigurationResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeactivateScalingConfigurationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeactivateScalingConfigurationResponseBody(name='body'),
}

async function deactivateScalingConfigurationWithOptions(request: DeactivateScalingConfigurationRequest, runtime: Util.RuntimeOptions): DeactivateScalingConfigurationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingConfigurationId)) {
    query['ScalingConfigurationId'] = request.scalingConfigurationId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeactivateScalingConfiguration',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deactivateScalingConfiguration(request: DeactivateScalingConfigurationRequest): DeactivateScalingConfigurationResponse {
  var runtime = new Util.RuntimeOptions{};
  return deactivateScalingConfigurationWithOptions(request, runtime);
}

model DeleteAlarmRequest {
  alarmTaskId?: string(name='AlarmTaskId'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
}

model DeleteAlarmResponseBody = {
  alarmTaskId?: string(name='AlarmTaskId'),
  requestId?: string(name='RequestId'),
}

model DeleteAlarmResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteAlarmResponseBody(name='body'),
}

async function deleteAlarmWithOptions(request: DeleteAlarmRequest, runtime: Util.RuntimeOptions): DeleteAlarmResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.alarmTaskId)) {
    query['AlarmTaskId'] = request.alarmTaskId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAlarm',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteAlarm(request: DeleteAlarmRequest): DeleteAlarmResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAlarmWithOptions(request, runtime);
}

model DeleteEciScalingConfigurationRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingConfigurationId?: string(name='ScalingConfigurationId'),
}

model DeleteEciScalingConfigurationResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteEciScalingConfigurationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteEciScalingConfigurationResponseBody(name='body'),
}

async function deleteEciScalingConfigurationWithOptions(request: DeleteEciScalingConfigurationRequest, runtime: Util.RuntimeOptions): DeleteEciScalingConfigurationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingConfigurationId)) {
    query['ScalingConfigurationId'] = request.scalingConfigurationId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteEciScalingConfiguration',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteEciScalingConfiguration(request: DeleteEciScalingConfigurationRequest): DeleteEciScalingConfigurationResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteEciScalingConfigurationWithOptions(request, runtime);
}

model DeleteLifecycleHookRequest {
  lifecycleHookId?: string(name='LifecycleHookId'),
  lifecycleHookName?: string(name='LifecycleHookName'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model DeleteLifecycleHookResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteLifecycleHookResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteLifecycleHookResponseBody(name='body'),
}

async function deleteLifecycleHookWithOptions(request: DeleteLifecycleHookRequest, runtime: Util.RuntimeOptions): DeleteLifecycleHookResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lifecycleHookId)) {
    query['LifecycleHookId'] = request.lifecycleHookId;
  }
  if (!Util.isUnset(request.lifecycleHookName)) {
    query['LifecycleHookName'] = request.lifecycleHookName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteLifecycleHook',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteLifecycleHook(request: DeleteLifecycleHookRequest): DeleteLifecycleHookResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteLifecycleHookWithOptions(request, runtime);
}

model DeleteNotificationConfigurationRequest {
  notificationArn?: string(name='NotificationArn'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model DeleteNotificationConfigurationResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteNotificationConfigurationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteNotificationConfigurationResponseBody(name='body'),
}

async function deleteNotificationConfigurationWithOptions(request: DeleteNotificationConfigurationRequest, runtime: Util.RuntimeOptions): DeleteNotificationConfigurationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.notificationArn)) {
    query['NotificationArn'] = request.notificationArn;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteNotificationConfiguration',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteNotificationConfiguration(request: DeleteNotificationConfigurationRequest): DeleteNotificationConfigurationResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteNotificationConfigurationWithOptions(request, runtime);
}

model DeleteScalingConfigurationRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingConfigurationId?: string(name='ScalingConfigurationId'),
}

model DeleteScalingConfigurationResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteScalingConfigurationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteScalingConfigurationResponseBody(name='body'),
}

async function deleteScalingConfigurationWithOptions(request: DeleteScalingConfigurationRequest, runtime: Util.RuntimeOptions): DeleteScalingConfigurationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingConfigurationId)) {
    query['ScalingConfigurationId'] = request.scalingConfigurationId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteScalingConfiguration',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteScalingConfiguration(request: DeleteScalingConfigurationRequest): DeleteScalingConfigurationResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteScalingConfigurationWithOptions(request, runtime);
}

model DeleteScalingGroupRequest {
  forceDelete?: boolean(name='ForceDelete'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model DeleteScalingGroupResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteScalingGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteScalingGroupResponseBody(name='body'),
}

async function deleteScalingGroupWithOptions(request: DeleteScalingGroupRequest, runtime: Util.RuntimeOptions): DeleteScalingGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.forceDelete)) {
    query['ForceDelete'] = request.forceDelete;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteScalingGroup',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteScalingGroup(request: DeleteScalingGroupRequest): DeleteScalingGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteScalingGroupWithOptions(request, runtime);
}

model DeleteScalingRuleRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingRuleId?: string(name='ScalingRuleId'),
}

model DeleteScalingRuleResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteScalingRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteScalingRuleResponseBody(name='body'),
}

async function deleteScalingRuleWithOptions(request: DeleteScalingRuleRequest, runtime: Util.RuntimeOptions): DeleteScalingRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingRuleId)) {
    query['ScalingRuleId'] = request.scalingRuleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteScalingRule',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteScalingRule(request: DeleteScalingRuleRequest): DeleteScalingRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteScalingRuleWithOptions(request, runtime);
}

model DeleteScheduledTaskRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scheduledTaskId?: string(name='ScheduledTaskId'),
}

model DeleteScheduledTaskResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteScheduledTaskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteScheduledTaskResponseBody(name='body'),
}

async function deleteScheduledTaskWithOptions(request: DeleteScheduledTaskRequest, runtime: Util.RuntimeOptions): DeleteScheduledTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scheduledTaskId)) {
    query['ScheduledTaskId'] = request.scheduledTaskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteScheduledTask',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteScheduledTask(request: DeleteScheduledTaskRequest): DeleteScheduledTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteScheduledTaskWithOptions(request, runtime);
}

model DescribeAlarmsRequest {
  alarmTaskId?: string(name='AlarmTaskId'),
  isEnable?: boolean(name='IsEnable'),
  metricName?: string(name='MetricName'),
  metricType?: string(name='MetricType'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
  state?: string(name='State'),
}

model DescribeAlarmsResponseBody = {
  alarmList?: {
    alarm?: [ 
    {
      alarmActions?: {
        alarmAction?: [ string ](name='AlarmAction')
      }(name='AlarmActions'),
      alarmTaskId?: string(name='AlarmTaskId'),
      comparisonOperator?: string(name='ComparisonOperator'),
      description?: string(name='Description'),
      dimensions?: {
        dimension?: [ 
        {
          dimensionKey?: string(name='DimensionKey'),
          dimensionValue?: string(name='DimensionValue'),
        }
      ](name='Dimension')
      }(name='Dimensions'),
      effective?: string(name='Effective'),
      enable?: boolean(name='Enable'),
      evaluationCount?: int32(name='EvaluationCount'),
      expressions?: {
        expression?: [ 
        {
          comparisonOperator?: string(name='ComparisonOperator'),
          metricName?: string(name='MetricName'),
          period?: int32(name='Period'),
          statistics?: string(name='Statistics'),
          threshold?: float(name='Threshold'),
        }
      ](name='Expression')
      }(name='Expressions'),
      expressionsLogicOperator?: string(name='ExpressionsLogicOperator'),
      metricName?: string(name='MetricName'),
      metricType?: string(name='MetricType'),
      name?: string(name='Name'),
      period?: int32(name='Period'),
      scalingGroupId?: string(name='ScalingGroupId'),
      state?: string(name='State'),
      statistics?: string(name='Statistics'),
      threshold?: float(name='Threshold'),
    }
  ](name='Alarm')
  }(name='AlarmList'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeAlarmsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeAlarmsResponseBody(name='body'),
}

async function describeAlarmsWithOptions(request: DescribeAlarmsRequest, runtime: Util.RuntimeOptions): DescribeAlarmsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.alarmTaskId)) {
    query['AlarmTaskId'] = request.alarmTaskId;
  }
  if (!Util.isUnset(request.isEnable)) {
    query['IsEnable'] = request.isEnable;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.metricType)) {
    query['MetricType'] = request.metricType;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  if (!Util.isUnset(request.state)) {
    query['State'] = request.state;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAlarms',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeAlarms(request: DescribeAlarmsRequest): DescribeAlarmsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAlarmsWithOptions(request, runtime);
}

model DescribeEciScalingConfigurationsRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scalingConfigurationId?: [ string ](name='ScalingConfigurationId'),
  scalingConfigurationName?: [ string ](name='ScalingConfigurationName'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model DescribeEciScalingConfigurationsResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  scalingConfigurations?: [ 
    {
      acrRegistryInfos?: [ 
        {
          domains?: [ string ](name='Domains'),
          instanceId?: string(name='InstanceId'),
          instanceName?: string(name='InstanceName'),
          regionId?: string(name='RegionId'),
        }
      ](name='AcrRegistryInfos'),
      activeDeadlineSeconds?: int32(name='ActiveDeadlineSeconds'),
      autoCreateEip?: boolean(name='AutoCreateEip'),
      autoMatchImageCache?: boolean(name='AutoMatchImageCache'),
      containerGroupName?: string(name='ContainerGroupName'),
      containers?: [ 
        {
          args?: [ string ](name='Args'),
          commands?: [ string ](name='Commands'),
          cpu?: float(name='Cpu'),
          environmentVars?: [ 
            {
              key?: string(name='Key'),
              value?: string(name='Value'),
            }
          ](name='EnvironmentVars'),
          gpu?: int32(name='Gpu'),
          image?: string(name='Image'),
          imagePullPolicy?: string(name='ImagePullPolicy'),
          livenessProbeExecCommands?: [ string ](name='LivenessProbeExecCommands'),
          livenessProbeFailureThreshold?: int32(name='LivenessProbeFailureThreshold'),
          livenessProbeHttpGetPath?: string(name='LivenessProbeHttpGetPath'),
          livenessProbeHttpGetPort?: int32(name='LivenessProbeHttpGetPort'),
          livenessProbeHttpGetScheme?: string(name='LivenessProbeHttpGetScheme'),
          livenessProbeInitialDelaySeconds?: int32(name='LivenessProbeInitialDelaySeconds'),
          livenessProbePeriodSeconds?: int32(name='LivenessProbePeriodSeconds'),
          livenessProbeSuccessThreshold?: int32(name='LivenessProbeSuccessThreshold'),
          livenessProbeTcpSocketPort?: int32(name='LivenessProbeTcpSocketPort'),
          livenessProbeTimeoutSeconds?: int32(name='LivenessProbeTimeoutSeconds'),
          memory?: float(name='Memory'),
          name?: string(name='Name'),
          ports?: [ 
            {
              port?: int32(name='Port'),
              protocol?: string(name='Protocol'),
            }
          ](name='Ports'),
          readinessProbeExecCommands?: [ string ](name='ReadinessProbeExecCommands'),
          readinessProbeFailureThreshold?: int32(name='ReadinessProbeFailureThreshold'),
          readinessProbeHttpGetPath?: string(name='ReadinessProbeHttpGetPath'),
          readinessProbeHttpGetPort?: int32(name='ReadinessProbeHttpGetPort'),
          readinessProbeHttpGetScheme?: string(name='ReadinessProbeHttpGetScheme'),
          readinessProbeInitialDelaySeconds?: int32(name='ReadinessProbeInitialDelaySeconds'),
          readinessProbePeriodSeconds?: int32(name='ReadinessProbePeriodSeconds'),
          readinessProbeSuccessThreshold?: int32(name='ReadinessProbeSuccessThreshold'),
          readinessProbeTcpSocketPort?: int32(name='ReadinessProbeTcpSocketPort'),
          readinessProbeTimeoutSeconds?: int32(name='ReadinessProbeTimeoutSeconds'),
          securityContextCapabilityAdds?: [ string ](name='SecurityContextCapabilityAdds'),
          securityContextRunAsUser?: long(name='SecurityContextRunAsUser'),
          stdin?: boolean(name='Stdin'),
          stdinOnce?: boolean(name='StdinOnce'),
          tty?: boolean(name='Tty'),
          volumeMounts?: [ 
            {
              mountPath?: string(name='MountPath'),
              mountPropagation?: string(name='MountPropagation'),
              name?: string(name='Name'),
              readOnly?: boolean(name='ReadOnly'),
              subPath?: string(name='SubPath'),
            }
          ](name='VolumeMounts'),
          workingDir?: string(name='WorkingDir'),
        }
      ](name='Containers'),
      costOptimization?: boolean(name='CostOptimization'),
      cpu?: float(name='Cpu'),
      cpuOptionsCore?: int32(name='CpuOptionsCore'),
      cpuOptionsThreadsPerCore?: int32(name='CpuOptionsThreadsPerCore'),
      creationTime?: string(name='CreationTime'),
      dnsConfigNameServers?: [ string ](name='DnsConfigNameServers'),
      dnsConfigOptions?: [ 
        {
          name?: string(name='Name'),
          value?: string(name='Value'),
        }
      ](name='DnsConfigOptions'),
      dnsConfigSearches?: [ string ](name='DnsConfigSearches'),
      dnsPolicy?: string(name='DnsPolicy'),
      egressBandwidth?: long(name='EgressBandwidth'),
      eipBandwidth?: int32(name='EipBandwidth'),
      ephemeralStorage?: int32(name='EphemeralStorage'),
      hostAliases?: [ 
        {
          hostnames?: [ string ](name='Hostnames'),
          ip?: string(name='Ip'),
        }
      ](name='HostAliases'),
      hostName?: string(name='HostName'),
      imageRegistryCredentials?: [ 
        {
          password?: string(name='Password'),
          server?: string(name='Server'),
          userName?: string(name='UserName'),
        }
      ](name='ImageRegistryCredentials'),
      imageSnapshotId?: string(name='ImageSnapshotId'),
      ingressBandwidth?: long(name='IngressBandwidth'),
      initContainers?: [ 
        {
          cpu?: float(name='Cpu'),
          gpu?: int32(name='Gpu'),
          image?: string(name='Image'),
          imagePullPolicy?: string(name='ImagePullPolicy'),
          initContainerArgs?: [ string ](name='InitContainerArgs'),
          initContainerCommands?: [ string ](name='InitContainerCommands'),
          initContainerEnvironmentVars?: [ 
            {
              key?: string(name='Key'),
              value?: string(name='Value'),
            }
          ](name='InitContainerEnvironmentVars'),
          initContainerVolumeMounts?: [ 
            {
              mountPath?: string(name='MountPath'),
              mountPropagation?: string(name='MountPropagation'),
              name?: string(name='Name'),
              readOnly?: boolean(name='ReadOnly'),
              subPath?: string(name='SubPath'),
            }
          ](name='InitContainerVolumeMounts'),
          memory?: float(name='Memory'),
          name?: string(name='Name'),
          securityContextCapabilityAdds?: [ string ](name='SecurityContextCapabilityAdds'),
          securityContextReadOnlyRootFilesystem?: boolean(name='SecurityContextReadOnlyRootFilesystem'),
          securityContextRunAsUser?: string(name='SecurityContextRunAsUser'),
          workingDir?: string(name='WorkingDir'),
        }
      ](name='InitContainers'),
      instanceFamilyLevel?: string(name='InstanceFamilyLevel'),
      ipv6AddressCount?: int32(name='Ipv6AddressCount'),
      lifecycleState?: string(name='LifecycleState'),
      loadBalancerWeight?: int32(name='LoadBalancerWeight'),
      memory?: float(name='Memory'),
      ntpServers?: [ string ](name='NtpServers'),
      ramRoleName?: string(name='RamRoleName'),
      regionId?: string(name='RegionId'),
      resourceGroupId?: string(name='ResourceGroupId'),
      restartPolicy?: string(name='RestartPolicy'),
      scalingConfigurationId?: string(name='ScalingConfigurationId'),
      scalingConfigurationName?: string(name='ScalingConfigurationName'),
      scalingGroupId?: string(name='ScalingGroupId'),
      securityContextSysCtls?: [ 
        {
          name?: string(name='Name'),
          value?: string(name='Value'),
        }
      ](name='SecurityContextSysCtls'),
      securityGroupId?: string(name='SecurityGroupId'),
      spotPriceLimit?: float(name='SpotPriceLimit'),
      spotStrategy?: string(name='SpotStrategy'),
      tags?: [ 
        {
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='Tags'),
      terminationGracePeriodSeconds?: int32(name='TerminationGracePeriodSeconds'),
      volumes?: [ 
        {
          configFileVolumeConfigFileToPaths?: [ 
            {
              content?: string(name='Content'),
              mode?: int32(name='Mode'),
              path?: string(name='Path'),
            }
          ](name='ConfigFileVolumeConfigFileToPaths'),
          configFileVolumeDefaultMode?: int32(name='ConfigFileVolumeDefaultMode'),
          diskVolumeDiskId?: string(name='DiskVolumeDiskId'),
          diskVolumeDiskSize?: int32(name='DiskVolumeDiskSize'),
          diskVolumeFsType?: string(name='DiskVolumeFsType'),
          emptyDirVolumeMedium?: string(name='EmptyDirVolumeMedium'),
          flexVolumeDriver?: string(name='FlexVolumeDriver'),
          flexVolumeFsType?: string(name='FlexVolumeFsType'),
          flexVolumeOptions?: string(name='FlexVolumeOptions'),
          NFSVolumePath?: string(name='NFSVolumePath'),
          NFSVolumeReadOnly?: boolean(name='NFSVolumeReadOnly'),
          NFSVolumeServer?: string(name='NFSVolumeServer'),
          name?: string(name='Name'),
          type?: string(name='Type'),
        }
      ](name='Volumes'),
    }
  ](name='ScalingConfigurations'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeEciScalingConfigurationsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeEciScalingConfigurationsResponseBody(name='body'),
}

async function describeEciScalingConfigurationsWithOptions(request: DescribeEciScalingConfigurationsRequest, runtime: Util.RuntimeOptions): DescribeEciScalingConfigurationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scalingConfigurationId)) {
    query['ScalingConfigurationId'] = request.scalingConfigurationId;
  }
  if (!Util.isUnset(request.scalingConfigurationName)) {
    query['ScalingConfigurationName'] = request.scalingConfigurationName;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeEciScalingConfigurations',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeEciScalingConfigurations(request: DescribeEciScalingConfigurationsRequest): DescribeEciScalingConfigurationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeEciScalingConfigurationsWithOptions(request, runtime);
}

model DescribeLifecycleActionsRequest {
  lifecycleActionStatus?: string(name='LifecycleActionStatus'),
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingActivityId?: string(name='ScalingActivityId'),
}

model DescribeLifecycleActionsResponseBody = {
  lifecycleActions?: {
    lifecycleAction?: [ 
    {
      instanceIds?: {
        instanceId?: [ string ](name='InstanceId')
      }(name='InstanceIds'),
      lifecycleActionResult?: string(name='LifecycleActionResult'),
      lifecycleActionStatus?: string(name='LifecycleActionStatus'),
      lifecycleActionToken?: string(name='LifecycleActionToken'),
      lifecycleHookId?: string(name='LifecycleHookId'),
    }
  ](name='LifecycleAction')
  }(name='LifecycleActions'),
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeLifecycleActionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeLifecycleActionsResponseBody(name='body'),
}

async function describeLifecycleActionsWithOptions(request: DescribeLifecycleActionsRequest, runtime: Util.RuntimeOptions): DescribeLifecycleActionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lifecycleActionStatus)) {
    query['LifecycleActionStatus'] = request.lifecycleActionStatus;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingActivityId)) {
    query['ScalingActivityId'] = request.scalingActivityId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeLifecycleActions',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeLifecycleActions(request: DescribeLifecycleActionsRequest): DescribeLifecycleActionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeLifecycleActionsWithOptions(request, runtime);
}

model DescribeLifecycleHooksRequest {
  lifecycleHookId?: [ string ](name='LifecycleHookId'),
  lifecycleHookName?: string(name='LifecycleHookName'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model DescribeLifecycleHooksResponseBody = {
  lifecycleHooks?: {
    lifecycleHook?: [ 
    {
      defaultResult?: string(name='DefaultResult'),
      heartbeatTimeout?: int32(name='HeartbeatTimeout'),
      lifecycleHookId?: string(name='LifecycleHookId'),
      lifecycleHookName?: string(name='LifecycleHookName'),
      lifecycleTransition?: string(name='LifecycleTransition'),
      notificationArn?: string(name='NotificationArn'),
      notificationMetadata?: string(name='NotificationMetadata'),
      scalingGroupId?: string(name='ScalingGroupId'),
    }
  ](name='LifecycleHook')
  }(name='LifecycleHooks'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeLifecycleHooksResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeLifecycleHooksResponseBody(name='body'),
}

async function describeLifecycleHooksWithOptions(request: DescribeLifecycleHooksRequest, runtime: Util.RuntimeOptions): DescribeLifecycleHooksResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lifecycleHookId)) {
    query['LifecycleHookId'] = request.lifecycleHookId;
  }
  if (!Util.isUnset(request.lifecycleHookName)) {
    query['LifecycleHookName'] = request.lifecycleHookName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeLifecycleHooks',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeLifecycleHooks(request: DescribeLifecycleHooksRequest): DescribeLifecycleHooksResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeLifecycleHooksWithOptions(request, runtime);
}

model DescribeLimitationRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
}

model DescribeLimitationResponseBody = {
  maxNumberOfAlbServerGroup?: int32(name='MaxNumberOfAlbServerGroup'),
  maxNumberOfDBInstances?: int32(name='MaxNumberOfDBInstances'),
  maxNumberOfLifecycleHooks?: int32(name='MaxNumberOfLifecycleHooks'),
  maxNumberOfLoadBalancers?: int32(name='MaxNumberOfLoadBalancers'),
  maxNumberOfMaxSize?: int32(name='MaxNumberOfMaxSize'),
  maxNumberOfMinSize?: int32(name='MaxNumberOfMinSize'),
  maxNumberOfNotificationConfigurations?: int32(name='MaxNumberOfNotificationConfigurations'),
  maxNumberOfScalingConfigurations?: int32(name='MaxNumberOfScalingConfigurations'),
  maxNumberOfScalingGroups?: int32(name='MaxNumberOfScalingGroups'),
  maxNumberOfScalingInstances?: int32(name='MaxNumberOfScalingInstances'),
  maxNumberOfScalingRules?: int32(name='MaxNumberOfScalingRules'),
  maxNumberOfScheduledTasks?: int32(name='MaxNumberOfScheduledTasks'),
  maxNumberOfVServerGroups?: int32(name='MaxNumberOfVServerGroups'),
  requestId?: string(name='RequestId'),
}

model DescribeLimitationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeLimitationResponseBody(name='body'),
}

async function describeLimitationWithOptions(request: DescribeLimitationRequest, runtime: Util.RuntimeOptions): DescribeLimitationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeLimitation',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeLimitation(request: DescribeLimitationRequest): DescribeLimitationResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeLimitationWithOptions(request, runtime);
}

model DescribeNotificationConfigurationsRequest {
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model DescribeNotificationConfigurationsResponseBody = {
  notificationConfigurationModels?: {
    notificationConfigurationModel?: [ 
    {
      notificationArn?: string(name='NotificationArn'),
      notificationTypes?: {
        notificationType?: [ string ](name='NotificationType')
      }(name='NotificationTypes'),
      scalingGroupId?: string(name='ScalingGroupId'),
    }
  ](name='NotificationConfigurationModel')
  }(name='NotificationConfigurationModels'),
  requestId?: string(name='RequestId'),
}

model DescribeNotificationConfigurationsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeNotificationConfigurationsResponseBody(name='body'),
}

async function describeNotificationConfigurationsWithOptions(request: DescribeNotificationConfigurationsRequest, runtime: Util.RuntimeOptions): DescribeNotificationConfigurationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeNotificationConfigurations',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeNotificationConfigurations(request: DescribeNotificationConfigurationsRequest): DescribeNotificationConfigurationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeNotificationConfigurationsWithOptions(request, runtime);
}

model DescribeNotificationTypesRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
}

model DescribeNotificationTypesResponseBody = {
  notificationTypes?: {
    notificationType?: [ string ](name='NotificationType')
  }(name='NotificationTypes'),
  requestId?: string(name='RequestId'),
}

model DescribeNotificationTypesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeNotificationTypesResponseBody(name='body'),
}

async function describeNotificationTypesWithOptions(request: DescribeNotificationTypesRequest, runtime: Util.RuntimeOptions): DescribeNotificationTypesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeNotificationTypes',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeNotificationTypes(request: DescribeNotificationTypesRequest): DescribeNotificationTypesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeNotificationTypesWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  acceptLanguage?: string(name='AcceptLanguage'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeRegionsResponseBody = {
  regions?: {
    region?: [ 
    {
      classicUnavailable?: boolean(name='ClassicUnavailable'),
      localName?: string(name='LocalName'),
      regionEndpoint?: string(name='RegionEndpoint'),
      regionId?: string(name='RegionId'),
      vpcUnavailable?: boolean(name='VpcUnavailable'),
    }
  ](name='Region')
  }(name='Regions'),
  requestId?: string(name='RequestId'),
}

model DescribeRegionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeRegionsResponseBody(name='body'),
}

async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRegions',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model DescribeScalingActivitiesRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scalingActivityId?: [ string ](name='ScalingActivityId'),
  scalingGroupId?: string(name='ScalingGroupId'),
  statusCode?: string(name='StatusCode'),
}

model DescribeScalingActivitiesResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  scalingActivities?: {
    scalingActivity?: [ 
    {
      attachedCapacity?: string(name='AttachedCapacity'),
      autoCreatedCapacity?: string(name='AutoCreatedCapacity'),
      cause?: string(name='Cause'),
      description?: string(name='Description'),
      endTime?: string(name='EndTime'),
      progress?: int32(name='Progress'),
      scalingActivityId?: string(name='ScalingActivityId'),
      scalingGroupId?: string(name='ScalingGroupId'),
      scalingInstanceNumber?: int32(name='ScalingInstanceNumber'),
      startTime?: string(name='StartTime'),
      statusCode?: string(name='StatusCode'),
      statusMessage?: string(name='StatusMessage'),
      totalCapacity?: string(name='TotalCapacity'),
    }
  ](name='ScalingActivity')
  }(name='ScalingActivities'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeScalingActivitiesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScalingActivitiesResponseBody(name='body'),
}

async function describeScalingActivitiesWithOptions(request: DescribeScalingActivitiesRequest, runtime: Util.RuntimeOptions): DescribeScalingActivitiesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scalingActivityId)) {
    query['ScalingActivityId'] = request.scalingActivityId;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  if (!Util.isUnset(request.statusCode)) {
    query['StatusCode'] = request.statusCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScalingActivities',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScalingActivities(request: DescribeScalingActivitiesRequest): DescribeScalingActivitiesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScalingActivitiesWithOptions(request, runtime);
}

model DescribeScalingActivityDetailRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scalingActivityId?: string(name='ScalingActivityId'),
}

model DescribeScalingActivityDetailResponseBody = {
  detail?: string(name='Detail'),
  requestId?: string(name='RequestId'),
  scalingActivityId?: string(name='ScalingActivityId'),
}

model DescribeScalingActivityDetailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScalingActivityDetailResponseBody(name='body'),
}

async function describeScalingActivityDetailWithOptions(request: DescribeScalingActivityDetailRequest, runtime: Util.RuntimeOptions): DescribeScalingActivityDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scalingActivityId)) {
    query['ScalingActivityId'] = request.scalingActivityId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScalingActivityDetail',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScalingActivityDetail(request: DescribeScalingActivityDetailRequest): DescribeScalingActivityDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScalingActivityDetailWithOptions(request, runtime);
}

model DescribeScalingConfigurationsRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scalingConfigurationId?: [ string ](name='ScalingConfigurationId'),
  scalingConfigurationName?: [ string ](name='ScalingConfigurationName'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model DescribeScalingConfigurationsResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  scalingConfigurations?: {
    scalingConfiguration?: [ 
    {
      privatePoolOptions: {
        id?: string(name='Id'),
        matchCriteria?: string(name='MatchCriteria'),
      }(name='PrivatePoolOptions'),
      systemDisk: {
        burstingEnabled?: boolean(name='BurstingEnabled'),
        encryptAlgorithm?: string(name='EncryptAlgorithm'),
        encrypted?: boolean(name='Encrypted'),
        KMSKeyId?: string(name='KMSKeyId'),
        provisionedIops?: long(name='ProvisionedIops'),
      }(name='SystemDisk'),
      affinity?: string(name='Affinity'),
      cpu?: int32(name='Cpu'),
      creationTime?: string(name='CreationTime'),
      creditSpecification?: string(name='CreditSpecification'),
      dataDisks?: {
        dataDisk?: [ 
        {
          autoSnapshotPolicyId?: string(name='AutoSnapshotPolicyId'),
          burstingEnabled?: boolean(name='BurstingEnabled'),
          categories?: {
            category?: [ string ](name='Category')
          }(name='Categories'),
          category?: string(name='Category'),
          deleteWithInstance?: boolean(name='DeleteWithInstance'),
          description?: string(name='Description'),
          device?: string(name='Device'),
          diskName?: string(name='DiskName'),
          encrypted?: string(name='Encrypted'),
          KMSKeyId?: string(name='KMSKeyId'),
          performanceLevel?: string(name='PerformanceLevel'),
          provisionedIops?: long(name='ProvisionedIops'),
          size?: int32(name='Size'),
          snapshotId?: string(name='SnapshotId'),
        }
      ](name='DataDisk')
      }(name='DataDisks'),
      dedicatedHostId?: string(name='DedicatedHostId'),
      deploymentSetId?: string(name='DeploymentSetId'),
      hostName?: string(name='HostName'),
      hpcClusterId?: string(name='HpcClusterId'),
      imageFamily?: string(name='ImageFamily'),
      imageId?: string(name='ImageId'),
      imageName?: string(name='ImageName'),
      instanceDescription?: string(name='InstanceDescription'),
      instanceGeneration?: string(name='InstanceGeneration'),
      instanceName?: string(name='InstanceName'),
      instancePatternInfos?: {
        instancePatternInfo?: [ 
        {
          architectures?: {
            architecture?: [ string ](name='Architecture')
          }(name='Architectures'),
          burstablePerformance?: string(name='BurstablePerformance'),
          cores?: int32(name='Cores'),
          excludedInstanceTypes?: {
            excludedInstanceType?: [ string ](name='ExcludedInstanceType')
          }(name='ExcludedInstanceTypes'),
          instanceFamilyLevel?: string(name='InstanceFamilyLevel'),
          maxPrice?: float(name='MaxPrice'),
          memory?: float(name='Memory'),
        }
      ](name='InstancePatternInfo')
      }(name='InstancePatternInfos'),
      instanceType?: string(name='InstanceType'),
      instanceTypes?: {
        instanceType?: [ string ](name='InstanceType')
      }(name='InstanceTypes'),
      internetChargeType?: string(name='InternetChargeType'),
      internetMaxBandwidthIn?: int32(name='InternetMaxBandwidthIn'),
      internetMaxBandwidthOut?: int32(name='InternetMaxBandwidthOut'),
      ioOptimized?: string(name='IoOptimized'),
      ipv6AddressCount?: int32(name='Ipv6AddressCount'),
      keyPairName?: string(name='KeyPairName'),
      lifecycleState?: string(name='LifecycleState'),
      loadBalancerWeight?: int32(name='LoadBalancerWeight'),
      memory?: int32(name='Memory'),
      passwordInherit?: boolean(name='PasswordInherit'),
      ramRoleName?: string(name='RamRoleName'),
      resourceGroupId?: string(name='ResourceGroupId'),
      scalingConfigurationId?: string(name='ScalingConfigurationId'),
      scalingConfigurationName?: string(name='ScalingConfigurationName'),
      scalingGroupId?: string(name='ScalingGroupId'),
      schedulerOptions?: {
        managedPrivateSpaceId?: string(name='ManagedPrivateSpaceId'),
      }(name='SchedulerOptions'),
      securityEnhancementStrategy?: string(name='SecurityEnhancementStrategy'),
      securityGroupId?: string(name='SecurityGroupId'),
      securityGroupIds?: {
        securityGroupId?: [ string ](name='SecurityGroupId')
      }(name='SecurityGroupIds'),
      spotDuration?: int32(name='SpotDuration'),
      spotInterruptionBehavior?: string(name='SpotInterruptionBehavior'),
      spotPriceLimit?: {
        spotPriceModel?: [ 
        {
          instanceType?: string(name='InstanceType'),
          priceLimit?: float(name='PriceLimit'),
        }
      ](name='SpotPriceModel')
      }(name='SpotPriceLimit'),
      spotStrategy?: string(name='SpotStrategy'),
      systemDiskAutoSnapshotPolicyId?: string(name='SystemDiskAutoSnapshotPolicyId'),
      systemDiskCategories?: {
        systemDiskCategory?: [ string ](name='SystemDiskCategory')
      }(name='SystemDiskCategories'),
      systemDiskCategory?: string(name='SystemDiskCategory'),
      systemDiskDescription?: string(name='SystemDiskDescription'),
      systemDiskName?: string(name='SystemDiskName'),
      systemDiskPerformanceLevel?: string(name='SystemDiskPerformanceLevel'),
      systemDiskSize?: int32(name='SystemDiskSize'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='Tag')
      }(name='Tags'),
      tenancy?: string(name='Tenancy'),
      userData?: string(name='UserData'),
      weightedCapacities?: {
        weightedCapacity?: [ string ](name='WeightedCapacity')
      }(name='WeightedCapacities'),
      zoneId?: string(name='ZoneId'),
    }
  ](name='ScalingConfiguration')
  }(name='ScalingConfigurations'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeScalingConfigurationsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScalingConfigurationsResponseBody(name='body'),
}

async function describeScalingConfigurationsWithOptions(request: DescribeScalingConfigurationsRequest, runtime: Util.RuntimeOptions): DescribeScalingConfigurationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scalingConfigurationId)) {
    query['ScalingConfigurationId'] = request.scalingConfigurationId;
  }
  if (!Util.isUnset(request.scalingConfigurationName)) {
    query['ScalingConfigurationName'] = request.scalingConfigurationName;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScalingConfigurations',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScalingConfigurations(request: DescribeScalingConfigurationsRequest): DescribeScalingConfigurationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScalingConfigurationsWithOptions(request, runtime);
}

model DescribeScalingGroupsRequest {
  scalingGroupName?: [ string ](name='ScalingGroupName'),
  groupType?: string(name='GroupType'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scalingGroupId?: [ string ](name='ScalingGroupId'),
}

model DescribeScalingGroupsResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  scalingGroups?: {
    scalingGroup?: [ 
    {
      activeCapacity?: int32(name='ActiveCapacity'),
      activeScalingConfigurationId?: string(name='ActiveScalingConfigurationId'),
      albServerGroups?: {
        albServerGroup?: [ 
        {
          albServerGroupId?: string(name='AlbServerGroupId'),
          port?: int32(name='Port'),
          weight?: int32(name='Weight'),
        }
      ](name='AlbServerGroup')
      }(name='AlbServerGroups'),
      allocationStrategy?: string(name='AllocationStrategy'),
      azBalance?: boolean(name='AzBalance'),
      compensateWithOnDemand?: boolean(name='CompensateWithOnDemand'),
      creationTime?: string(name='CreationTime'),
      DBInstanceIds?: {
        DBInstanceId?: [ string ](name='DBInstanceId')
      }(name='DBInstanceIds'),
      defaultCooldown?: int32(name='DefaultCooldown'),
      desiredCapacity?: int32(name='DesiredCapacity'),
      groupDeletionProtection?: boolean(name='GroupDeletionProtection'),
      groupType?: string(name='GroupType'),
      healthCheckType?: string(name='HealthCheckType'),
      launchTemplateId?: string(name='LaunchTemplateId'),
      launchTemplateOverrides?: {
        launchTemplateOverride?: [ 
        {
          instanceType?: string(name='InstanceType'),
          weightedCapacity?: int32(name='WeightedCapacity'),
        }
      ](name='LaunchTemplateOverride')
      }(name='LaunchTemplateOverrides'),
      launchTemplateVersion?: string(name='LaunchTemplateVersion'),
      lifecycleState?: string(name='LifecycleState'),
      loadBalancerIds?: {
        loadBalancerId?: [ string ](name='LoadBalancerId')
      }(name='LoadBalancerIds'),
      maxInstanceLifetime?: int32(name='MaxInstanceLifetime'),
      maxSize?: int32(name='MaxSize'),
      minSize?: int32(name='MinSize'),
      modificationTime?: string(name='ModificationTime'),
      monitorGroupId?: string(name='MonitorGroupId'),
      multiAZPolicy?: string(name='MultiAZPolicy'),
      onDemandBaseCapacity?: int32(name='OnDemandBaseCapacity'),
      onDemandPercentageAboveBaseCapacity?: int32(name='OnDemandPercentageAboveBaseCapacity'),
      pendingCapacity?: int32(name='PendingCapacity'),
      pendingWaitCapacity?: int32(name='PendingWaitCapacity'),
      protectedCapacity?: int32(name='ProtectedCapacity'),
      regionId?: string(name='RegionId'),
      removalPolicies?: {
        removalPolicy?: [ string ](name='RemovalPolicy')
      }(name='RemovalPolicies'),
      removingCapacity?: int32(name='RemovingCapacity'),
      removingWaitCapacity?: int32(name='RemovingWaitCapacity'),
      scalingGroupId?: string(name='ScalingGroupId'),
      scalingGroupName?: string(name='ScalingGroupName'),
      scalingPolicy?: string(name='ScalingPolicy'),
      spotAllocationStrategy?: string(name='SpotAllocationStrategy'),
      spotInstancePools?: int32(name='SpotInstancePools'),
      spotInstanceRemedy?: boolean(name='SpotInstanceRemedy'),
      standbyCapacity?: int32(name='StandbyCapacity'),
      stoppedCapacity?: int32(name='StoppedCapacity'),
      suspendedProcesses?: {
        suspendedProcess?: [ string ](name='SuspendedProcess')
      }(name='SuspendedProcesses'),
      systemSuspended?: boolean(name='SystemSuspended'),
      totalCapacity?: int32(name='TotalCapacity'),
      totalInstanceCount?: int32(name='TotalInstanceCount'),
      VServerGroups?: {
        VServerGroup?: [ 
        {
          loadBalancerId?: string(name='LoadBalancerId'),
          VServerGroupAttributes?: {
            VServerGroupAttribute?: [ 
            {
              port?: int32(name='Port'),
              VServerGroupId?: string(name='VServerGroupId'),
              weight?: int32(name='Weight'),
            }
          ](name='VServerGroupAttribute')
          }(name='VServerGroupAttributes'),
        }
      ](name='VServerGroup')
      }(name='VServerGroups'),
      vSwitchId?: string(name='VSwitchId'),
      vSwitchIds?: {
        vSwitchId?: [ string ](name='VSwitchId')
      }(name='VSwitchIds'),
      vpcId?: string(name='VpcId'),
    }
  ](name='ScalingGroup')
  }(name='ScalingGroups'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeScalingGroupsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScalingGroupsResponseBody(name='body'),
}

async function describeScalingGroupsWithOptions(request: DescribeScalingGroupsRequest, runtime: Util.RuntimeOptions): DescribeScalingGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupType)) {
    query['GroupType'] = request.groupType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  if (!Util.isUnset(request.scalingGroupName)) {
    query['ScalingGroupName'] = request.scalingGroupName;
  }
  if (!Util.isUnset(request.scalingGroupName)) {
    query['ScalingGroupName'] = request.scalingGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScalingGroups',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScalingGroups(request: DescribeScalingGroupsRequest): DescribeScalingGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScalingGroupsWithOptions(request, runtime);
}

model DescribeScalingInstancesRequest {
  creationType?: string(name='CreationType'),
  healthStatus?: string(name='HealthStatus'),
  instanceId?: [ string ](name='InstanceId'),
  lifecycleState?: string(name='LifecycleState'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scalingActivityId?: string(name='ScalingActivityId'),
  scalingConfigurationId?: string(name='ScalingConfigurationId'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model DescribeScalingInstancesResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  scalingInstances?: {
    scalingInstance?: [ 
    {
      createdTime?: string(name='CreatedTime'),
      creationTime?: string(name='CreationTime'),
      creationType?: string(name='CreationType'),
      entrusted?: boolean(name='Entrusted'),
      healthStatus?: string(name='HealthStatus'),
      instanceId?: string(name='InstanceId'),
      launchTemplateId?: string(name='LaunchTemplateId'),
      launchTemplateVersion?: string(name='LaunchTemplateVersion'),
      lifecycleState?: string(name='LifecycleState'),
      loadBalancerWeight?: int32(name='LoadBalancerWeight'),
      scalingActivityId?: string(name='ScalingActivityId'),
      scalingConfigurationId?: string(name='ScalingConfigurationId'),
      scalingGroupId?: string(name='ScalingGroupId'),
      spotStrategy?: string(name='SpotStrategy'),
      warmupState?: string(name='WarmupState'),
      weightedCapacity?: int32(name='WeightedCapacity'),
      zoneId?: string(name='ZoneId'),
    }
  ](name='ScalingInstance')
  }(name='ScalingInstances'),
  totalCount?: int32(name='TotalCount'),
  totalSpotCount?: int32(name='TotalSpotCount'),
}

model DescribeScalingInstancesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScalingInstancesResponseBody(name='body'),
}

async function describeScalingInstancesWithOptions(request: DescribeScalingInstancesRequest, runtime: Util.RuntimeOptions): DescribeScalingInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.creationType)) {
    query['CreationType'] = request.creationType;
  }
  if (!Util.isUnset(request.healthStatus)) {
    query['HealthStatus'] = request.healthStatus;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.lifecycleState)) {
    query['LifecycleState'] = request.lifecycleState;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scalingActivityId)) {
    query['ScalingActivityId'] = request.scalingActivityId;
  }
  if (!Util.isUnset(request.scalingConfigurationId)) {
    query['ScalingConfigurationId'] = request.scalingConfigurationId;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScalingInstances',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScalingInstances(request: DescribeScalingInstancesRequest): DescribeScalingInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScalingInstancesWithOptions(request, runtime);
}

model DescribeScalingRulesRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scalingGroupId?: string(name='ScalingGroupId'),
  scalingRuleAri?: [ string ](name='ScalingRuleAri'),
  scalingRuleId?: [ string ](name='ScalingRuleId'),
  scalingRuleName?: [ string ](name='ScalingRuleName'),
  scalingRuleType?: string(name='ScalingRuleType'),
  showAlarmRules?: boolean(name='ShowAlarmRules'),
}

model DescribeScalingRulesResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  scalingRules?: {
    scalingRule?: [ 
    {
      adjustmentType?: string(name='AdjustmentType'),
      adjustmentValue?: int32(name='AdjustmentValue'),
      alarms?: {
        alarm?: [ 
        {
          alarmTaskId?: string(name='AlarmTaskId'),
          alarmTaskName?: string(name='AlarmTaskName'),
          comparisonOperator?: string(name='ComparisonOperator'),
          dimensions?: {
            dimension?: [ 
            {
              dimensionKey?: string(name='DimensionKey'),
              dimensionValue?: string(name='DimensionValue'),
            }
          ](name='Dimension')
          }(name='Dimensions'),
          evaluationCount?: int32(name='EvaluationCount'),
          metricName?: string(name='MetricName'),
          metricType?: string(name='MetricType'),
          statistics?: string(name='Statistics'),
          threshold?: float(name='Threshold'),
        }
      ](name='Alarm')
      }(name='Alarms'),
      cooldown?: int32(name='Cooldown'),
      disableScaleIn?: boolean(name='DisableScaleIn'),
      estimatedInstanceWarmup?: int32(name='EstimatedInstanceWarmup'),
      initialMaxSize?: int32(name='InitialMaxSize'),
      maxSize?: int32(name='MaxSize'),
      metricName?: string(name='MetricName'),
      minAdjustmentMagnitude?: int32(name='MinAdjustmentMagnitude'),
      minSize?: int32(name='MinSize'),
      predictiveScalingMode?: string(name='PredictiveScalingMode'),
      predictiveTaskBufferTime?: int32(name='PredictiveTaskBufferTime'),
      predictiveValueBehavior?: string(name='PredictiveValueBehavior'),
      predictiveValueBuffer?: int32(name='PredictiveValueBuffer'),
      scaleInEvaluationCount?: int32(name='ScaleInEvaluationCount'),
      scaleOutEvaluationCount?: int32(name='ScaleOutEvaluationCount'),
      scalingGroupId?: string(name='ScalingGroupId'),
      scalingRuleAri?: string(name='ScalingRuleAri'),
      scalingRuleId?: string(name='ScalingRuleId'),
      scalingRuleName?: string(name='ScalingRuleName'),
      scalingRuleType?: string(name='ScalingRuleType'),
      stepAdjustments?: {
        stepAdjustment?: [ 
        {
          metricIntervalLowerBound?: float(name='MetricIntervalLowerBound'),
          metricIntervalUpperBound?: float(name='MetricIntervalUpperBound'),
          scalingAdjustment?: int32(name='ScalingAdjustment'),
        }
      ](name='StepAdjustment')
      }(name='StepAdjustments'),
      targetValue?: float(name='TargetValue'),
    }
  ](name='ScalingRule')
  }(name='ScalingRules'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeScalingRulesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScalingRulesResponseBody(name='body'),
}

async function describeScalingRulesWithOptions(request: DescribeScalingRulesRequest, runtime: Util.RuntimeOptions): DescribeScalingRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  if (!Util.isUnset(request.scalingRuleAri)) {
    query['ScalingRuleAri'] = request.scalingRuleAri;
  }
  if (!Util.isUnset(request.scalingRuleId)) {
    query['ScalingRuleId'] = request.scalingRuleId;
  }
  if (!Util.isUnset(request.scalingRuleName)) {
    query['ScalingRuleName'] = request.scalingRuleName;
  }
  if (!Util.isUnset(request.scalingRuleType)) {
    query['ScalingRuleType'] = request.scalingRuleType;
  }
  if (!Util.isUnset(request.showAlarmRules)) {
    query['ShowAlarmRules'] = request.showAlarmRules;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScalingRules',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScalingRules(request: DescribeScalingRulesRequest): DescribeScalingRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScalingRulesWithOptions(request, runtime);
}

model DescribeScheduledTasksRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scalingGroupId?: string(name='ScalingGroupId'),
  scheduledAction?: [ string ](name='ScheduledAction'),
  scheduledTaskId?: [ string ](name='ScheduledTaskId'),
  scheduledTaskName?: [ string ](name='ScheduledTaskName'),
}

model DescribeScheduledTasksResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  scheduledTasks?: {
    scheduledTask?: [ 
    {
      description?: string(name='Description'),
      desiredCapacity?: int32(name='DesiredCapacity'),
      launchExpirationTime?: int32(name='LaunchExpirationTime'),
      launchTime?: string(name='LaunchTime'),
      maxValue?: int32(name='MaxValue'),
      minValue?: int32(name='MinValue'),
      recurrenceEndTime?: string(name='RecurrenceEndTime'),
      recurrenceType?: string(name='RecurrenceType'),
      recurrenceValue?: string(name='RecurrenceValue'),
      scalingGroupId?: string(name='ScalingGroupId'),
      scheduledAction?: string(name='ScheduledAction'),
      scheduledTaskId?: string(name='ScheduledTaskId'),
      scheduledTaskName?: string(name='ScheduledTaskName'),
      taskEnabled?: boolean(name='TaskEnabled'),
    }
  ](name='ScheduledTask')
  }(name='ScheduledTasks'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeScheduledTasksResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScheduledTasksResponseBody(name='body'),
}

async function describeScheduledTasksWithOptions(request: DescribeScheduledTasksRequest, runtime: Util.RuntimeOptions): DescribeScheduledTasksResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  if (!Util.isUnset(request.scheduledAction)) {
    query['ScheduledAction'] = request.scheduledAction;
  }
  if (!Util.isUnset(request.scheduledTaskId)) {
    query['ScheduledTaskId'] = request.scheduledTaskId;
  }
  if (!Util.isUnset(request.scheduledTaskName)) {
    query['ScheduledTaskName'] = request.scheduledTaskName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScheduledTasks',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScheduledTasks(request: DescribeScheduledTasksRequest): DescribeScheduledTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScheduledTasksWithOptions(request, runtime);
}

model DetachAlbServerGroupsRequest {
  albServerGroup?: [ 
    {
      albServerGroupId?: string(name='AlbServerGroupId'),
      port?: int32(name='Port'),
    }
  ](name='AlbServerGroup'),
  clientToken?: string(name='ClientToken'),
  forceDetach?: boolean(name='ForceDetach'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model DetachAlbServerGroupsResponseBody = {
  requestId?: string(name='RequestId'),
  scalingActivityId?: string(name='ScalingActivityId'),
}

model DetachAlbServerGroupsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DetachAlbServerGroupsResponseBody(name='body'),
}

async function detachAlbServerGroupsWithOptions(request: DetachAlbServerGroupsRequest, runtime: Util.RuntimeOptions): DetachAlbServerGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.albServerGroup)) {
    query['AlbServerGroup'] = request.albServerGroup;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.forceDetach)) {
    query['ForceDetach'] = request.forceDetach;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DetachAlbServerGroups',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function detachAlbServerGroups(request: DetachAlbServerGroupsRequest): DetachAlbServerGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return detachAlbServerGroupsWithOptions(request, runtime);
}

model DetachDBInstancesRequest {
  clientToken?: string(name='ClientToken'),
  DBInstance?: [ string ](name='DBInstance'),
  forceDetach?: boolean(name='ForceDetach'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model DetachDBInstancesResponseBody = {
  requestId?: string(name='RequestId'),
}

model DetachDBInstancesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DetachDBInstancesResponseBody(name='body'),
}

async function detachDBInstancesWithOptions(request: DetachDBInstancesRequest, runtime: Util.RuntimeOptions): DetachDBInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.DBInstance)) {
    query['DBInstance'] = request.DBInstance;
  }
  if (!Util.isUnset(request.forceDetach)) {
    query['ForceDetach'] = request.forceDetach;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DetachDBInstances',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function detachDBInstances(request: DetachDBInstancesRequest): DetachDBInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return detachDBInstancesWithOptions(request, runtime);
}

model DetachInstancesRequest {
  decreaseDesiredCapacity?: boolean(name='DecreaseDesiredCapacity'),
  detachOption?: string(name='DetachOption'),
  instanceId?: [ string ](name='InstanceId'),
  lifecycleHook?: boolean(name='LifecycleHook'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model DetachInstancesResponseBody = {
  requestId?: string(name='RequestId'),
  scalingActivityId?: string(name='ScalingActivityId'),
}

model DetachInstancesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DetachInstancesResponseBody(name='body'),
}

async function detachInstancesWithOptions(request: DetachInstancesRequest, runtime: Util.RuntimeOptions): DetachInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.decreaseDesiredCapacity)) {
    query['DecreaseDesiredCapacity'] = request.decreaseDesiredCapacity;
  }
  if (!Util.isUnset(request.detachOption)) {
    query['DetachOption'] = request.detachOption;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.lifecycleHook)) {
    query['LifecycleHook'] = request.lifecycleHook;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DetachInstances',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function detachInstances(request: DetachInstancesRequest): DetachInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return detachInstancesWithOptions(request, runtime);
}

model DetachLoadBalancersRequest {
  async?: boolean(name='Async'),
  clientToken?: string(name='ClientToken'),
  forceDetach?: boolean(name='ForceDetach'),
  loadBalancer?: [ string ](name='LoadBalancer'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model DetachLoadBalancersResponseBody = {
  requestId?: string(name='RequestId'),
  scalingActivityId?: string(name='ScalingActivityId'),
}

model DetachLoadBalancersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DetachLoadBalancersResponseBody(name='body'),
}

async function detachLoadBalancersWithOptions(request: DetachLoadBalancersRequest, runtime: Util.RuntimeOptions): DetachLoadBalancersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.async)) {
    query['Async'] = request.async;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.forceDetach)) {
    query['ForceDetach'] = request.forceDetach;
  }
  if (!Util.isUnset(request.loadBalancer)) {
    query['LoadBalancer'] = request.loadBalancer;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DetachLoadBalancers',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function detachLoadBalancers(request: DetachLoadBalancersRequest): DetachLoadBalancersResponse {
  var runtime = new Util.RuntimeOptions{};
  return detachLoadBalancersWithOptions(request, runtime);
}

model DetachVServerGroupsRequest {
  clientToken?: string(name='ClientToken'),
  forceDetach?: boolean(name='ForceDetach'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
  VServerGroup?: [ 
    {
      loadBalancerId?: string(name='LoadBalancerId'),
      VServerGroupAttribute?: [ 
        {
          port?: int32(name='Port'),
          VServerGroupId?: string(name='VServerGroupId'),
        }
      ](name='VServerGroupAttribute'),
    }
  ](name='VServerGroup'),
}

model DetachVServerGroupsResponseBody = {
  requestId?: string(name='RequestId'),
}

model DetachVServerGroupsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DetachVServerGroupsResponseBody(name='body'),
}

async function detachVServerGroupsWithOptions(request: DetachVServerGroupsRequest, runtime: Util.RuntimeOptions): DetachVServerGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.forceDetach)) {
    query['ForceDetach'] = request.forceDetach;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  if (!Util.isUnset(request.VServerGroup)) {
    query['VServerGroup'] = request.VServerGroup;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DetachVServerGroups',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function detachVServerGroups(request: DetachVServerGroupsRequest): DetachVServerGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return detachVServerGroupsWithOptions(request, runtime);
}

model DisableAlarmRequest {
  alarmTaskId?: string(name='AlarmTaskId'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
}

model DisableAlarmResponseBody = {
  requestId?: string(name='RequestId'),
}

model DisableAlarmResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DisableAlarmResponseBody(name='body'),
}

async function disableAlarmWithOptions(request: DisableAlarmRequest, runtime: Util.RuntimeOptions): DisableAlarmResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.alarmTaskId)) {
    query['AlarmTaskId'] = request.alarmTaskId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableAlarm',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disableAlarm(request: DisableAlarmRequest): DisableAlarmResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableAlarmWithOptions(request, runtime);
}

model DisableScalingGroupRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model DisableScalingGroupResponseBody = {
  requestId?: string(name='RequestId'),
}

model DisableScalingGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DisableScalingGroupResponseBody(name='body'),
}

async function disableScalingGroupWithOptions(request: DisableScalingGroupRequest, runtime: Util.RuntimeOptions): DisableScalingGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableScalingGroup',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disableScalingGroup(request: DisableScalingGroupRequest): DisableScalingGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableScalingGroupWithOptions(request, runtime);
}

model EnableAlarmRequest {
  alarmTaskId?: string(name='AlarmTaskId'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
}

model EnableAlarmResponseBody = {
  requestId?: string(name='RequestId'),
}

model EnableAlarmResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: EnableAlarmResponseBody(name='body'),
}

async function enableAlarmWithOptions(request: EnableAlarmRequest, runtime: Util.RuntimeOptions): EnableAlarmResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.alarmTaskId)) {
    query['AlarmTaskId'] = request.alarmTaskId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableAlarm',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enableAlarm(request: EnableAlarmRequest): EnableAlarmResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableAlarmWithOptions(request, runtime);
}

model EnableScalingGroupRequest {
  activeScalingConfigurationId?: string(name='ActiveScalingConfigurationId'),
  instanceId?: [ string ](name='InstanceId'),
  launchTemplateId?: string(name='LaunchTemplateId'),
  launchTemplateOverride?: [ 
    {
      instanceType?: string(name='InstanceType'),
      weightedCapacity?: int32(name='WeightedCapacity'),
    }
  ](name='LaunchTemplateOverride'),
  launchTemplateVersion?: string(name='LaunchTemplateVersion'),
  loadBalancerWeight?: [ int32 ](name='LoadBalancerWeight'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model EnableScalingGroupResponseBody = {
  requestId?: string(name='RequestId'),
}

model EnableScalingGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: EnableScalingGroupResponseBody(name='body'),
}

async function enableScalingGroupWithOptions(request: EnableScalingGroupRequest, runtime: Util.RuntimeOptions): EnableScalingGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.activeScalingConfigurationId)) {
    query['ActiveScalingConfigurationId'] = request.activeScalingConfigurationId;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.launchTemplateId)) {
    query['LaunchTemplateId'] = request.launchTemplateId;
  }
  if (!Util.isUnset(request.launchTemplateOverride)) {
    query['LaunchTemplateOverride'] = request.launchTemplateOverride;
  }
  if (!Util.isUnset(request.launchTemplateVersion)) {
    query['LaunchTemplateVersion'] = request.launchTemplateVersion;
  }
  if (!Util.isUnset(request.loadBalancerWeight)) {
    query['LoadBalancerWeight'] = request.loadBalancerWeight;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableScalingGroup',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enableScalingGroup(request: EnableScalingGroupRequest): EnableScalingGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableScalingGroupWithOptions(request, runtime);
}

model EnterStandbyRequest {
  async?: boolean(name='Async'),
  clientToken?: string(name='ClientToken'),
  instanceId?: [ string ](name='InstanceId'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model EnterStandbyResponseBody = {
  requestId?: string(name='RequestId'),
  scalingActivityId?: string(name='ScalingActivityId'),
}

model EnterStandbyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: EnterStandbyResponseBody(name='body'),
}

async function enterStandbyWithOptions(request: EnterStandbyRequest, runtime: Util.RuntimeOptions): EnterStandbyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.async)) {
    query['Async'] = request.async;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnterStandby',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enterStandby(request: EnterStandbyRequest): EnterStandbyResponse {
  var runtime = new Util.RuntimeOptions{};
  return enterStandbyWithOptions(request, runtime);
}

model ExecuteScalingRuleRequest {
  breachThreshold?: float(name='BreachThreshold'),
  clientToken?: string(name='ClientToken'),
  metricValue?: float(name='MetricValue'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scalingRuleAri?: string(name='ScalingRuleAri'),
}

model ExecuteScalingRuleResponseBody = {
  requestId?: string(name='RequestId'),
  scalingActivityId?: string(name='ScalingActivityId'),
}

model ExecuteScalingRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ExecuteScalingRuleResponseBody(name='body'),
}

async function executeScalingRuleWithOptions(request: ExecuteScalingRuleRequest, runtime: Util.RuntimeOptions): ExecuteScalingRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.breachThreshold)) {
    query['BreachThreshold'] = request.breachThreshold;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.metricValue)) {
    query['MetricValue'] = request.metricValue;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scalingRuleAri)) {
    query['ScalingRuleAri'] = request.scalingRuleAri;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteScalingRule',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function executeScalingRule(request: ExecuteScalingRuleRequest): ExecuteScalingRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return executeScalingRuleWithOptions(request, runtime);
}

model ExitStandbyRequest {
  async?: boolean(name='Async'),
  clientToken?: string(name='ClientToken'),
  instanceId?: [ string ](name='InstanceId'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model ExitStandbyResponseBody = {
  requestId?: string(name='RequestId'),
  scalingActivityId?: string(name='ScalingActivityId'),
}

model ExitStandbyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ExitStandbyResponseBody(name='body'),
}

async function exitStandbyWithOptions(request: ExitStandbyRequest, runtime: Util.RuntimeOptions): ExitStandbyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.async)) {
    query['Async'] = request.async;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ExitStandby',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function exitStandby(request: ExitStandbyRequest): ExitStandbyResponse {
  var runtime = new Util.RuntimeOptions{};
  return exitStandbyWithOptions(request, runtime);
}

model ListTagKeysRequest {
  nextToken?: string(name='NextToken'),
  ownerId?: long(name='OwnerId'),
  pageSize?: int32(name='PageSize'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceType?: string(name='ResourceType'),
}

model ListTagKeysResponseBody = {
  keys?: {
    key?: [ string ](name='Key')
  }(name='Keys'),
  nextToken?: string(name='NextToken'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
}

model ListTagKeysResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListTagKeysResponseBody(name='body'),
}

async function listTagKeysWithOptions(request: ListTagKeysRequest, runtime: Util.RuntimeOptions): ListTagKeysResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTagKeys',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listTagKeys(request: ListTagKeysRequest): ListTagKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagKeysWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  nextToken?: string(name='NextToken'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceId?: [ string ](name='ResourceId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceType?: string(name='ResourceType'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
}

model ListTagResourcesResponseBody = {
  nextToken?: string(name='NextToken'),
  requestId?: string(name='RequestId'),
  tagResources?: {
    tagResource?: [ 
    {
      propagate?: boolean(name='Propagate'),
      resourceId?: string(name='ResourceId'),
      resourceType?: string(name='ResourceType'),
      tagKey?: string(name='TagKey'),
      tagValue?: string(name='TagValue'),
    }
  ](name='TagResource')
  }(name='TagResources'),
}

model ListTagResourcesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListTagResourcesResponseBody(name='body'),
}

async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: Util.RuntimeOptions): ListTagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTagResources',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model ListTagValuesRequest {
  key?: string(name='Key'),
  nextToken?: string(name='NextToken'),
  ownerId?: long(name='OwnerId'),
  pageSize?: int32(name='PageSize'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceType?: string(name='ResourceType'),
}

model ListTagValuesResponseBody = {
  nextToken?: string(name='NextToken'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  values?: {
    value?: [ string ](name='Value')
  }(name='Values'),
}

model ListTagValuesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListTagValuesResponseBody(name='body'),
}

async function listTagValuesWithOptions(request: ListTagValuesRequest, runtime: Util.RuntimeOptions): ListTagValuesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.key)) {
    query['Key'] = request.key;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTagValues',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listTagValues(request: ListTagValuesRequest): ListTagValuesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagValuesWithOptions(request, runtime);
}

model ModifyAlarmRequest {
  alarmAction?: [ string ](name='AlarmAction'),
  alarmTaskId?: string(name='AlarmTaskId'),
  comparisonOperator?: string(name='ComparisonOperator'),
  description?: string(name='Description'),
  dimension?: [ 
    {
      dimensionKey?: string(name='DimensionKey'),
      dimensionValue?: string(name='DimensionValue'),
    }
  ](name='Dimension'),
  effective?: string(name='Effective'),
  evaluationCount?: int32(name='EvaluationCount'),
  expression?: [ 
    {
      comparisonOperator?: string(name='ComparisonOperator'),
      metricName?: string(name='MetricName'),
      period?: int32(name='Period'),
      statistics?: string(name='Statistics'),
      threshold?: float(name='Threshold'),
    }
  ](name='Expression'),
  expressionsLogicOperator?: string(name='ExpressionsLogicOperator'),
  groupId?: int32(name='GroupId'),
  metricName?: string(name='MetricName'),
  metricType?: string(name='MetricType'),
  name?: string(name='Name'),
  ownerId?: long(name='OwnerId'),
  period?: int32(name='Period'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  statistics?: string(name='Statistics'),
  threshold?: float(name='Threshold'),
}

model ModifyAlarmResponseBody = {
  alarmTaskId?: string(name='AlarmTaskId'),
  requestId?: string(name='RequestId'),
}

model ModifyAlarmResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyAlarmResponseBody(name='body'),
}

async function modifyAlarmWithOptions(request: ModifyAlarmRequest, runtime: Util.RuntimeOptions): ModifyAlarmResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.alarmAction)) {
    query['AlarmAction'] = request.alarmAction;
  }
  if (!Util.isUnset(request.alarmTaskId)) {
    query['AlarmTaskId'] = request.alarmTaskId;
  }
  if (!Util.isUnset(request.comparisonOperator)) {
    query['ComparisonOperator'] = request.comparisonOperator;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.dimension)) {
    query['Dimension'] = request.dimension;
  }
  if (!Util.isUnset(request.effective)) {
    query['Effective'] = request.effective;
  }
  if (!Util.isUnset(request.evaluationCount)) {
    query['EvaluationCount'] = request.evaluationCount;
  }
  if (!Util.isUnset(request.expression)) {
    query['Expression'] = request.expression;
  }
  if (!Util.isUnset(request.expressionsLogicOperator)) {
    query['ExpressionsLogicOperator'] = request.expressionsLogicOperator;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.metricType)) {
    query['MetricType'] = request.metricType;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.statistics)) {
    query['Statistics'] = request.statistics;
  }
  if (!Util.isUnset(request.threshold)) {
    query['Threshold'] = request.threshold;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyAlarm',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyAlarm(request: ModifyAlarmRequest): ModifyAlarmResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAlarmWithOptions(request, runtime);
}

model ModifyEciScalingConfigurationRequest {
  acrRegistryInfo?: [ 
    {
      domain?: [ string ](name='Domain'),
      instanceId?: string(name='InstanceId'),
      instanceName?: string(name='InstanceName'),
      regionId?: string(name='RegionId'),
    }
  ](name='AcrRegistryInfo'),
  activeDeadlineSeconds?: long(name='ActiveDeadlineSeconds'),
  autoCreateEip?: boolean(name='AutoCreateEip'),
  autoMatchImageCache?: boolean(name='AutoMatchImageCache'),
  container?: [ 
    {
      livenessProbe: {
        exec: {
            command?: [ string ](name='Command'),
        }(name='Exec'),
        failureThreshold?: int32(name='FailureThreshold'),
        httpGet: {
            path?: string(name='Path'),
            port?: int32(name='Port'),
            scheme?: string(name='Scheme'),
        }(name='HttpGet'),
        initialDelaySeconds?: int32(name='InitialDelaySeconds'),
        periodSeconds?: int32(name='PeriodSeconds'),
        successThreshold?: int32(name='SuccessThreshold'),
        tcpSocket: {
            port?: int32(name='Port'),
        }(name='TcpSocket'),
        timeoutSeconds?: int32(name='TimeoutSeconds'),
      }(name='LivenessProbe'),
      readinessProbe: {
        exec: {
            command?: [ string ](name='Command'),
        }(name='Exec'),
        failureThreshold?: int32(name='FailureThreshold'),
        httpGet: {
            path?: string(name='Path'),
            port?: int32(name='Port'),
            scheme?: string(name='Scheme'),
        }(name='HttpGet'),
        initialDelaySeconds?: int32(name='InitialDelaySeconds'),
        periodSeconds?: int32(name='PeriodSeconds'),
        successThreshold?: int32(name='SuccessThreshold'),
        tcpSocket: {
            port?: int32(name='Port'),
        }(name='TcpSocket'),
        timeoutSeconds?: int32(name='TimeoutSeconds'),
      }(name='ReadinessProbe'),
      securityContext: {
        capability: {
            add?: [ string ](name='Add'),
        }(name='Capability'),
        readOnlyRootFilesystem?: boolean(name='ReadOnlyRootFilesystem'),
        runAsUser?: long(name='RunAsUser'),
      }(name='SecurityContext'),
      arg?: [ string ](name='Arg'),
      command?: [ string ](name='Command'),
      cpu?: float(name='Cpu'),
      environmentVar?: [ 
        {
          fieldRef: {
            fieldPath?: string(name='FieldPath'),
          }(name='FieldRef'),
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='EnvironmentVar'),
      gpu?: int32(name='Gpu'),
      image?: string(name='Image'),
      imagePullPolicy?: string(name='ImagePullPolicy'),
      memory?: float(name='Memory'),
      name?: string(name='Name'),
      port?: [ 
        {
          port?: int32(name='Port'),
          protocol?: string(name='Protocol'),
        }
      ](name='Port'),
      stdin?: boolean(name='Stdin'),
      stdinOnce?: boolean(name='StdinOnce'),
      tty?: boolean(name='Tty'),
      volumeMount?: [ 
        {
          mountPath?: string(name='MountPath'),
          mountPropagation?: string(name='MountPropagation'),
          name?: string(name='Name'),
          readOnly?: boolean(name='ReadOnly'),
          subPath?: string(name='SubPath'),
        }
      ](name='VolumeMount'),
      workingDir?: string(name='WorkingDir'),
    }
  ](name='Container'),
  containerGroupName?: string(name='ContainerGroupName'),
  costOptimization?: boolean(name='CostOptimization'),
  cpu?: float(name='Cpu'),
  cpuOptionsCore?: int32(name='CpuOptionsCore'),
  cpuOptionsThreadsPerCore?: int32(name='CpuOptionsThreadsPerCore'),
  dnsConfigNameServer?: [ string ](name='DnsConfigNameServer'),
  dnsConfigOption?: [ 
    {
      name?: string(name='Name'),
      value?: string(name='Value'),
    }
  ](name='DnsConfigOption'),
  dnsConfigSearch?: [ string ](name='DnsConfigSearch'),
  dnsPolicy?: string(name='DnsPolicy'),
  egressBandwidth?: long(name='EgressBandwidth'),
  eipBandwidth?: int32(name='EipBandwidth'),
  ephemeralStorage?: int32(name='EphemeralStorage'),
  hostAliase?: [ 
    {
      hostname?: [ string ](name='Hostname'),
      ip?: string(name='Ip'),
    }
  ](name='HostAliase'),
  hostName?: string(name='HostName'),
  imageRegistryCredential?: [ 
    {
      password?: string(name='Password'),
      server?: string(name='Server'),
      userName?: string(name='UserName'),
    }
  ](name='ImageRegistryCredential'),
  imageSnapshotId?: string(name='ImageSnapshotId'),
  ingressBandwidth?: long(name='IngressBandwidth'),
  initContainer?: [ 
    {
      securityContext: {
        capability: {
            add?: [ string ](name='Add'),
        }(name='Capability'),
        readOnlyRootFilesystem?: boolean(name='ReadOnlyRootFilesystem'),
        runAsUser?: long(name='RunAsUser'),
      }(name='SecurityContext'),
      arg?: [ string ](name='Arg'),
      command?: [ string ](name='Command'),
      cpu?: float(name='Cpu'),
      gpu?: int32(name='Gpu'),
      image?: string(name='Image'),
      imagePullPolicy?: string(name='ImagePullPolicy'),
      initContainerEnvironmentVar?: [ 
        {
          fieldRef: {
            fieldPath?: string(name='FieldPath'),
          }(name='FieldRef'),
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='InitContainerEnvironmentVar'),
      initContainerVolumeMount?: [ 
        {
          mountPath?: string(name='MountPath'),
          mountPropagation?: string(name='MountPropagation'),
          name?: string(name='Name'),
          readOnly?: boolean(name='ReadOnly'),
          subPath?: string(name='SubPath'),
        }
      ](name='InitContainerVolumeMount'),
      memory?: float(name='Memory'),
      name?: string(name='Name'),
      workingDir?: string(name='WorkingDir'),
    }
  ](name='InitContainer'),
  instanceFamilyLevel?: string(name='InstanceFamilyLevel'),
  ipv6AddressCount?: int32(name='Ipv6AddressCount'),
  loadBalancerWeight?: int32(name='LoadBalancerWeight'),
  memory?: float(name='Memory'),
  ntpServer?: [ string ](name='NtpServer'),
  ownerId?: long(name='OwnerId'),
  ramRoleName?: string(name='RamRoleName'),
  resourceGroupId?: string(name='ResourceGroupId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  restartPolicy?: string(name='RestartPolicy'),
  scalingConfigurationId?: string(name='ScalingConfigurationId'),
  scalingConfigurationName?: string(name='ScalingConfigurationName'),
  securityContextSysctl?: [ 
    {
      name?: string(name='Name'),
      value?: string(name='Value'),
    }
  ](name='SecurityContextSysctl'),
  securityGroupId?: string(name='SecurityGroupId'),
  spotPriceLimit?: float(name='SpotPriceLimit'),
  spotStrategy?: string(name='SpotStrategy'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
  terminationGracePeriodSeconds?: long(name='TerminationGracePeriodSeconds'),
  volume?: [ 
    {
      diskVolume: {
        diskId?: string(name='DiskId'),
        diskSize?: int32(name='DiskSize'),
        fsType?: string(name='FsType'),
      }(name='DiskVolume'),
      emptyDirVolume: {
        medium?: string(name='Medium'),
      }(name='EmptyDirVolume'),
      flexVolume: {
        driver?: string(name='Driver'),
        fsType?: string(name='FsType'),
        options?: string(name='Options'),
      }(name='FlexVolume'),
      hostPathVolume: {
        path?: string(name='Path'),
        type?: string(name='Type'),
      }(name='HostPathVolume'),
      NFSVolume: {
        path?: string(name='Path'),
        readOnly?: boolean(name='ReadOnly'),
        server?: string(name='Server'),
      }(name='NFSVolume'),
      configFileVolumeConfigFileToPath?: [ 
        {
          content?: string(name='Content'),
          mode?: int32(name='Mode'),
          path?: string(name='Path'),
        }
      ](name='ConfigFileVolumeConfigFileToPath'),
      configFileVolumeDefaultMode?: int32(name='ConfigFileVolumeDefaultMode'),
      name?: string(name='Name'),
      type?: string(name='Type'),
    }
  ](name='Volume'),
}

model ModifyEciScalingConfigurationResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyEciScalingConfigurationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyEciScalingConfigurationResponseBody(name='body'),
}

async function modifyEciScalingConfigurationWithOptions(request: ModifyEciScalingConfigurationRequest, runtime: Util.RuntimeOptions): ModifyEciScalingConfigurationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acrRegistryInfo)) {
    query['AcrRegistryInfo'] = request.acrRegistryInfo;
  }
  if (!Util.isUnset(request.activeDeadlineSeconds)) {
    query['ActiveDeadlineSeconds'] = request.activeDeadlineSeconds;
  }
  if (!Util.isUnset(request.autoCreateEip)) {
    query['AutoCreateEip'] = request.autoCreateEip;
  }
  if (!Util.isUnset(request.autoMatchImageCache)) {
    query['AutoMatchImageCache'] = request.autoMatchImageCache;
  }
  if (!Util.isUnset(request.container)) {
    query['Container'] = request.container;
  }
  if (!Util.isUnset(request.containerGroupName)) {
    query['ContainerGroupName'] = request.containerGroupName;
  }
  if (!Util.isUnset(request.costOptimization)) {
    query['CostOptimization'] = request.costOptimization;
  }
  if (!Util.isUnset(request.cpu)) {
    query['Cpu'] = request.cpu;
  }
  if (!Util.isUnset(request.cpuOptionsCore)) {
    query['CpuOptionsCore'] = request.cpuOptionsCore;
  }
  if (!Util.isUnset(request.cpuOptionsThreadsPerCore)) {
    query['CpuOptionsThreadsPerCore'] = request.cpuOptionsThreadsPerCore;
  }
  if (!Util.isUnset(request.dnsConfigNameServer)) {
    query['DnsConfigNameServer'] = request.dnsConfigNameServer;
  }
  if (!Util.isUnset(request.dnsConfigOption)) {
    query['DnsConfigOption'] = request.dnsConfigOption;
  }
  if (!Util.isUnset(request.dnsConfigSearch)) {
    query['DnsConfigSearch'] = request.dnsConfigSearch;
  }
  if (!Util.isUnset(request.dnsPolicy)) {
    query['DnsPolicy'] = request.dnsPolicy;
  }
  if (!Util.isUnset(request.egressBandwidth)) {
    query['EgressBandwidth'] = request.egressBandwidth;
  }
  if (!Util.isUnset(request.eipBandwidth)) {
    query['EipBandwidth'] = request.eipBandwidth;
  }
  if (!Util.isUnset(request.ephemeralStorage)) {
    query['EphemeralStorage'] = request.ephemeralStorage;
  }
  if (!Util.isUnset(request.hostAliase)) {
    query['HostAliase'] = request.hostAliase;
  }
  if (!Util.isUnset(request.hostName)) {
    query['HostName'] = request.hostName;
  }
  if (!Util.isUnset(request.imageRegistryCredential)) {
    query['ImageRegistryCredential'] = request.imageRegistryCredential;
  }
  if (!Util.isUnset(request.imageSnapshotId)) {
    query['ImageSnapshotId'] = request.imageSnapshotId;
  }
  if (!Util.isUnset(request.ingressBandwidth)) {
    query['IngressBandwidth'] = request.ingressBandwidth;
  }
  if (!Util.isUnset(request.initContainer)) {
    query['InitContainer'] = request.initContainer;
  }
  if (!Util.isUnset(request.instanceFamilyLevel)) {
    query['InstanceFamilyLevel'] = request.instanceFamilyLevel;
  }
  if (!Util.isUnset(request.ipv6AddressCount)) {
    query['Ipv6AddressCount'] = request.ipv6AddressCount;
  }
  if (!Util.isUnset(request.loadBalancerWeight)) {
    query['LoadBalancerWeight'] = request.loadBalancerWeight;
  }
  if (!Util.isUnset(request.memory)) {
    query['Memory'] = request.memory;
  }
  if (!Util.isUnset(request.ntpServer)) {
    query['NtpServer'] = request.ntpServer;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.ramRoleName)) {
    query['RamRoleName'] = request.ramRoleName;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.restartPolicy)) {
    query['RestartPolicy'] = request.restartPolicy;
  }
  if (!Util.isUnset(request.scalingConfigurationId)) {
    query['ScalingConfigurationId'] = request.scalingConfigurationId;
  }
  if (!Util.isUnset(request.scalingConfigurationName)) {
    query['ScalingConfigurationName'] = request.scalingConfigurationName;
  }
  if (!Util.isUnset(request.securityContextSysctl)) {
    query['SecurityContextSysctl'] = request.securityContextSysctl;
  }
  if (!Util.isUnset(request.securityGroupId)) {
    query['SecurityGroupId'] = request.securityGroupId;
  }
  if (!Util.isUnset(request.spotPriceLimit)) {
    query['SpotPriceLimit'] = request.spotPriceLimit;
  }
  if (!Util.isUnset(request.spotStrategy)) {
    query['SpotStrategy'] = request.spotStrategy;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!Util.isUnset(request.terminationGracePeriodSeconds)) {
    query['TerminationGracePeriodSeconds'] = request.terminationGracePeriodSeconds;
  }
  if (!Util.isUnset(request.volume)) {
    query['Volume'] = request.volume;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyEciScalingConfiguration',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyEciScalingConfiguration(request: ModifyEciScalingConfigurationRequest): ModifyEciScalingConfigurationResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyEciScalingConfigurationWithOptions(request, runtime);
}

model ModifyLifecycleHookRequest {
  defaultResult?: string(name='DefaultResult'),
  heartbeatTimeout?: int32(name='HeartbeatTimeout'),
  lifecycleHookId?: string(name='LifecycleHookId'),
  lifecycleHookName?: string(name='LifecycleHookName'),
  lifecycleTransition?: string(name='LifecycleTransition'),
  notificationArn?: string(name='NotificationArn'),
  notificationMetadata?: string(name='NotificationMetadata'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model ModifyLifecycleHookResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyLifecycleHookResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyLifecycleHookResponseBody(name='body'),
}

async function modifyLifecycleHookWithOptions(request: ModifyLifecycleHookRequest, runtime: Util.RuntimeOptions): ModifyLifecycleHookResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.defaultResult)) {
    query['DefaultResult'] = request.defaultResult;
  }
  if (!Util.isUnset(request.heartbeatTimeout)) {
    query['HeartbeatTimeout'] = request.heartbeatTimeout;
  }
  if (!Util.isUnset(request.lifecycleHookId)) {
    query['LifecycleHookId'] = request.lifecycleHookId;
  }
  if (!Util.isUnset(request.lifecycleHookName)) {
    query['LifecycleHookName'] = request.lifecycleHookName;
  }
  if (!Util.isUnset(request.lifecycleTransition)) {
    query['LifecycleTransition'] = request.lifecycleTransition;
  }
  if (!Util.isUnset(request.notificationArn)) {
    query['NotificationArn'] = request.notificationArn;
  }
  if (!Util.isUnset(request.notificationMetadata)) {
    query['NotificationMetadata'] = request.notificationMetadata;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyLifecycleHook',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyLifecycleHook(request: ModifyLifecycleHookRequest): ModifyLifecycleHookResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyLifecycleHookWithOptions(request, runtime);
}

model ModifyNotificationConfigurationRequest {
  notificationArn?: string(name='NotificationArn'),
  notificationType?: [ string ](name='NotificationType'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model ModifyNotificationConfigurationResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyNotificationConfigurationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyNotificationConfigurationResponseBody(name='body'),
}

async function modifyNotificationConfigurationWithOptions(request: ModifyNotificationConfigurationRequest, runtime: Util.RuntimeOptions): ModifyNotificationConfigurationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.notificationArn)) {
    query['NotificationArn'] = request.notificationArn;
  }
  if (!Util.isUnset(request.notificationType)) {
    query['NotificationType'] = request.notificationType;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyNotificationConfiguration',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyNotificationConfiguration(request: ModifyNotificationConfigurationRequest): ModifyNotificationConfigurationResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyNotificationConfigurationWithOptions(request, runtime);
}

model ModifyScalingConfigurationRequest {
  privatePoolOptions?: {
    id?: string(name='Id'),
    matchCriteria?: string(name='MatchCriteria'),
  }(name='PrivatePoolOptions'),
  systemDisk?: {
    autoSnapshotPolicyId?: string(name='AutoSnapshotPolicyId'),
    burstingEnabled?: boolean(name='BurstingEnabled'),
    category?: string(name='Category'),
    description?: string(name='Description'),
    diskName?: string(name='DiskName'),
    encryptAlgorithm?: string(name='EncryptAlgorithm'),
    encrypted?: boolean(name='Encrypted'),
    KMSKeyId?: string(name='KMSKeyId'),
    performanceLevel?: string(name='PerformanceLevel'),
    provisionedIops?: long(name='ProvisionedIops'),
    size?: int32(name='Size'),
  }(name='SystemDisk'),
  affinity?: string(name='Affinity'),
  cpu?: int32(name='Cpu'),
  creditSpecification?: string(name='CreditSpecification'),
  dataDisk?: [ 
    {
      autoSnapshotPolicyId?: string(name='AutoSnapshotPolicyId'),
      burstingEnabled?: boolean(name='BurstingEnabled'),
      categories?: [ string ](name='Categories'),
      category?: string(name='Category'),
      deleteWithInstance?: boolean(name='DeleteWithInstance'),
      description?: string(name='Description'),
      device?: string(name='Device'),
      diskName?: string(name='DiskName'),
      encrypted?: string(name='Encrypted'),
      KMSKeyId?: string(name='KMSKeyId'),
      performanceLevel?: string(name='PerformanceLevel'),
      provisionedIops?: long(name='ProvisionedIops'),
      size?: int32(name='Size'),
      snapshotId?: string(name='SnapshotId'),
    }
  ](name='DataDisk'),
  dedicatedHostId?: string(name='DedicatedHostId'),
  deploymentSetId?: string(name='DeploymentSetId'),
  hostName?: string(name='HostName'),
  hpcClusterId?: string(name='HpcClusterId'),
  imageFamily?: string(name='ImageFamily'),
  imageId?: string(name='ImageId'),
  imageName?: string(name='ImageName'),
  instanceDescription?: string(name='InstanceDescription'),
  instanceName?: string(name='InstanceName'),
  instancePatternInfo?: [ 
    {
      architecture?: [ string ](name='Architecture'),
      burstablePerformance?: string(name='BurstablePerformance'),
      cores?: int32(name='Cores'),
      excludedInstanceType?: [ string ](name='ExcludedInstanceType'),
      instanceFamilyLevel?: string(name='InstanceFamilyLevel'),
      maxPrice?: float(name='MaxPrice'),
      memory?: float(name='Memory'),
    }
  ](name='InstancePatternInfo'),
  instanceTypeOverride?: [ 
    {
      instanceType?: string(name='InstanceType'),
      weightedCapacity?: int32(name='WeightedCapacity'),
    }
  ](name='InstanceTypeOverride'),
  instanceTypes?: [ string ](name='InstanceTypes'),
  internetChargeType?: string(name='InternetChargeType'),
  internetMaxBandwidthOut?: int32(name='InternetMaxBandwidthOut'),
  ioOptimized?: string(name='IoOptimized'),
  ipv6AddressCount?: int32(name='Ipv6AddressCount'),
  keyPairName?: string(name='KeyPairName'),
  loadBalancerWeight?: int32(name='LoadBalancerWeight'),
  memory?: int32(name='Memory'),
  override?: boolean(name='Override'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  passwordInherit?: boolean(name='PasswordInherit'),
  ramRoleName?: string(name='RamRoleName'),
  resourceGroupId?: string(name='ResourceGroupId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingConfigurationId?: string(name='ScalingConfigurationId'),
  scalingConfigurationName?: string(name='ScalingConfigurationName'),
  schedulerOptions?: map[string]any(name='SchedulerOptions'),
  securityGroupId?: string(name='SecurityGroupId'),
  securityGroupIds?: [ string ](name='SecurityGroupIds'),
  spotDuration?: int32(name='SpotDuration'),
  spotInterruptionBehavior?: string(name='SpotInterruptionBehavior'),
  spotPriceLimit?: [ 
    {
      instanceType?: string(name='InstanceType'),
      priceLimit?: float(name='PriceLimit'),
    }
  ](name='SpotPriceLimit'),
  spotStrategy?: string(name='SpotStrategy'),
  systemDiskCategories?: [ string ](name='SystemDiskCategories'),
  tags?: string(name='Tags'),
  tenancy?: string(name='Tenancy'),
  userData?: string(name='UserData'),
  zoneId?: string(name='ZoneId'),
}

model ModifyScalingConfigurationShrinkRequest {
  privatePoolOptions?: {
    id?: string(name='Id'),
    matchCriteria?: string(name='MatchCriteria'),
  }(name='PrivatePoolOptions'),
  systemDisk?: {
    autoSnapshotPolicyId?: string(name='AutoSnapshotPolicyId'),
    burstingEnabled?: boolean(name='BurstingEnabled'),
    category?: string(name='Category'),
    description?: string(name='Description'),
    diskName?: string(name='DiskName'),
    encryptAlgorithm?: string(name='EncryptAlgorithm'),
    encrypted?: boolean(name='Encrypted'),
    KMSKeyId?: string(name='KMSKeyId'),
    performanceLevel?: string(name='PerformanceLevel'),
    provisionedIops?: long(name='ProvisionedIops'),
    size?: int32(name='Size'),
  }(name='SystemDisk'),
  affinity?: string(name='Affinity'),
  cpu?: int32(name='Cpu'),
  creditSpecification?: string(name='CreditSpecification'),
  dataDisk?: [ 
    {
      autoSnapshotPolicyId?: string(name='AutoSnapshotPolicyId'),
      burstingEnabled?: boolean(name='BurstingEnabled'),
      categories?: [ string ](name='Categories'),
      category?: string(name='Category'),
      deleteWithInstance?: boolean(name='DeleteWithInstance'),
      description?: string(name='Description'),
      device?: string(name='Device'),
      diskName?: string(name='DiskName'),
      encrypted?: string(name='Encrypted'),
      KMSKeyId?: string(name='KMSKeyId'),
      performanceLevel?: string(name='PerformanceLevel'),
      provisionedIops?: long(name='ProvisionedIops'),
      size?: int32(name='Size'),
      snapshotId?: string(name='SnapshotId'),
    }
  ](name='DataDisk'),
  dedicatedHostId?: string(name='DedicatedHostId'),
  deploymentSetId?: string(name='DeploymentSetId'),
  hostName?: string(name='HostName'),
  hpcClusterId?: string(name='HpcClusterId'),
  imageFamily?: string(name='ImageFamily'),
  imageId?: string(name='ImageId'),
  imageName?: string(name='ImageName'),
  instanceDescription?: string(name='InstanceDescription'),
  instanceName?: string(name='InstanceName'),
  instancePatternInfo?: [ 
    {
      architecture?: [ string ](name='Architecture'),
      burstablePerformance?: string(name='BurstablePerformance'),
      cores?: int32(name='Cores'),
      excludedInstanceType?: [ string ](name='ExcludedInstanceType'),
      instanceFamilyLevel?: string(name='InstanceFamilyLevel'),
      maxPrice?: float(name='MaxPrice'),
      memory?: float(name='Memory'),
    }
  ](name='InstancePatternInfo'),
  instanceTypeOverride?: [ 
    {
      instanceType?: string(name='InstanceType'),
      weightedCapacity?: int32(name='WeightedCapacity'),
    }
  ](name='InstanceTypeOverride'),
  instanceTypes?: [ string ](name='InstanceTypes'),
  internetChargeType?: string(name='InternetChargeType'),
  internetMaxBandwidthOut?: int32(name='InternetMaxBandwidthOut'),
  ioOptimized?: string(name='IoOptimized'),
  ipv6AddressCount?: int32(name='Ipv6AddressCount'),
  keyPairName?: string(name='KeyPairName'),
  loadBalancerWeight?: int32(name='LoadBalancerWeight'),
  memory?: int32(name='Memory'),
  override?: boolean(name='Override'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  passwordInherit?: boolean(name='PasswordInherit'),
  ramRoleName?: string(name='RamRoleName'),
  resourceGroupId?: string(name='ResourceGroupId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingConfigurationId?: string(name='ScalingConfigurationId'),
  scalingConfigurationName?: string(name='ScalingConfigurationName'),
  schedulerOptionsShrink?: string(name='SchedulerOptions'),
  securityGroupId?: string(name='SecurityGroupId'),
  securityGroupIds?: [ string ](name='SecurityGroupIds'),
  spotDuration?: int32(name='SpotDuration'),
  spotInterruptionBehavior?: string(name='SpotInterruptionBehavior'),
  spotPriceLimit?: [ 
    {
      instanceType?: string(name='InstanceType'),
      priceLimit?: float(name='PriceLimit'),
    }
  ](name='SpotPriceLimit'),
  spotStrategy?: string(name='SpotStrategy'),
  systemDiskCategories?: [ string ](name='SystemDiskCategories'),
  tags?: string(name='Tags'),
  tenancy?: string(name='Tenancy'),
  userData?: string(name='UserData'),
  zoneId?: string(name='ZoneId'),
}

model ModifyScalingConfigurationResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyScalingConfigurationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyScalingConfigurationResponseBody(name='body'),
}

async function modifyScalingConfigurationWithOptions(tmpReq: ModifyScalingConfigurationRequest, runtime: Util.RuntimeOptions): ModifyScalingConfigurationResponse {
  Util.validateModel(tmpReq);
  var request = new ModifyScalingConfigurationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.schedulerOptions)) {
    request.schedulerOptionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.schedulerOptions, 'SchedulerOptions', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.affinity)) {
    query['Affinity'] = request.affinity;
  }
  if (!Util.isUnset(request.cpu)) {
    query['Cpu'] = request.cpu;
  }
  if (!Util.isUnset(request.creditSpecification)) {
    query['CreditSpecification'] = request.creditSpecification;
  }
  if (!Util.isUnset(request.dataDisk)) {
    query['DataDisk'] = request.dataDisk;
  }
  if (!Util.isUnset(request.dedicatedHostId)) {
    query['DedicatedHostId'] = request.dedicatedHostId;
  }
  if (!Util.isUnset(request.deploymentSetId)) {
    query['DeploymentSetId'] = request.deploymentSetId;
  }
  if (!Util.isUnset(request.hostName)) {
    query['HostName'] = request.hostName;
  }
  if (!Util.isUnset(request.hpcClusterId)) {
    query['HpcClusterId'] = request.hpcClusterId;
  }
  if (!Util.isUnset(request.imageFamily)) {
    query['ImageFamily'] = request.imageFamily;
  }
  if (!Util.isUnset(request.imageId)) {
    query['ImageId'] = request.imageId;
  }
  if (!Util.isUnset(request.imageName)) {
    query['ImageName'] = request.imageName;
  }
  if (!Util.isUnset(request.instanceDescription)) {
    query['InstanceDescription'] = request.instanceDescription;
  }
  if (!Util.isUnset(request.instanceName)) {
    query['InstanceName'] = request.instanceName;
  }
  if (!Util.isUnset(request.instancePatternInfo)) {
    query['InstancePatternInfo'] = request.instancePatternInfo;
  }
  if (!Util.isUnset(request.instanceTypeOverride)) {
    query['InstanceTypeOverride'] = request.instanceTypeOverride;
  }
  if (!Util.isUnset(request.instanceTypes)) {
    query['InstanceTypes'] = request.instanceTypes;
  }
  if (!Util.isUnset(request.internetChargeType)) {
    query['InternetChargeType'] = request.internetChargeType;
  }
  if (!Util.isUnset(request.internetMaxBandwidthOut)) {
    query['InternetMaxBandwidthOut'] = request.internetMaxBandwidthOut;
  }
  if (!Util.isUnset(request.ioOptimized)) {
    query['IoOptimized'] = request.ioOptimized;
  }
  if (!Util.isUnset(request.ipv6AddressCount)) {
    query['Ipv6AddressCount'] = request.ipv6AddressCount;
  }
  if (!Util.isUnset(request.keyPairName)) {
    query['KeyPairName'] = request.keyPairName;
  }
  if (!Util.isUnset(request.loadBalancerWeight)) {
    query['LoadBalancerWeight'] = request.loadBalancerWeight;
  }
  if (!Util.isUnset(request.memory)) {
    query['Memory'] = request.memory;
  }
  if (!Util.isUnset(request.override)) {
    query['Override'] = request.override;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.passwordInherit)) {
    query['PasswordInherit'] = request.passwordInherit;
  }
  if (!Util.isUnset(request.ramRoleName)) {
    query['RamRoleName'] = request.ramRoleName;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingConfigurationId)) {
    query['ScalingConfigurationId'] = request.scalingConfigurationId;
  }
  if (!Util.isUnset(request.scalingConfigurationName)) {
    query['ScalingConfigurationName'] = request.scalingConfigurationName;
  }
  if (!Util.isUnset(request.schedulerOptionsShrink)) {
    query['SchedulerOptions'] = request.schedulerOptionsShrink;
  }
  if (!Util.isUnset(request.securityGroupId)) {
    query['SecurityGroupId'] = request.securityGroupId;
  }
  if (!Util.isUnset(request.securityGroupIds)) {
    query['SecurityGroupIds'] = request.securityGroupIds;
  }
  if (!Util.isUnset(request.spotDuration)) {
    query['SpotDuration'] = request.spotDuration;
  }
  if (!Util.isUnset(request.spotInterruptionBehavior)) {
    query['SpotInterruptionBehavior'] = request.spotInterruptionBehavior;
  }
  if (!Util.isUnset(request.spotPriceLimit)) {
    query['SpotPriceLimit'] = request.spotPriceLimit;
  }
  if (!Util.isUnset(request.spotStrategy)) {
    query['SpotStrategy'] = request.spotStrategy;
  }
  if (!Util.isUnset(request.systemDiskCategories)) {
    query['SystemDiskCategories'] = request.systemDiskCategories;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!Util.isUnset(request.tenancy)) {
    query['Tenancy'] = request.tenancy;
  }
  if (!Util.isUnset(request.userData)) {
    query['UserData'] = request.userData;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  if (!Util.isUnset(request.privatePoolOptions)) {
    query['PrivatePoolOptions'] = request.privatePoolOptions;
  }
  if (!Util.isUnset(request.systemDisk)) {
    query['SystemDisk'] = request.systemDisk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyScalingConfiguration',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyScalingConfiguration(request: ModifyScalingConfigurationRequest): ModifyScalingConfigurationResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyScalingConfigurationWithOptions(request, runtime);
}

model ModifyScalingGroupRequest {
  removalPolicy?: [ string ](name='RemovalPolicy'),
  activeScalingConfigurationId?: string(name='ActiveScalingConfigurationId'),
  allocationStrategy?: string(name='AllocationStrategy'),
  azBalance?: boolean(name='AzBalance'),
  compensateWithOnDemand?: boolean(name='CompensateWithOnDemand'),
  defaultCooldown?: int32(name='DefaultCooldown'),
  desiredCapacity?: int32(name='DesiredCapacity'),
  groupDeletionProtection?: boolean(name='GroupDeletionProtection'),
  healthCheckType?: string(name='HealthCheckType'),
  launchTemplateId?: string(name='LaunchTemplateId'),
  launchTemplateOverride?: [ 
    {
      instanceType?: string(name='InstanceType'),
      weightedCapacity?: int32(name='WeightedCapacity'),
    }
  ](name='LaunchTemplateOverride'),
  launchTemplateVersion?: string(name='LaunchTemplateVersion'),
  maxInstanceLifetime?: int32(name='MaxInstanceLifetime'),
  maxSize?: int32(name='MaxSize'),
  minSize?: int32(name='MinSize'),
  multiAZPolicy?: string(name='MultiAZPolicy'),
  onDemandBaseCapacity?: int32(name='OnDemandBaseCapacity'),
  onDemandPercentageAboveBaseCapacity?: int32(name='OnDemandPercentageAboveBaseCapacity'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scalingGroupId?: string(name='ScalingGroupId'),
  scalingGroupName?: string(name='ScalingGroupName'),
  spotAllocationStrategy?: string(name='SpotAllocationStrategy'),
  spotInstancePools?: int32(name='SpotInstancePools'),
  spotInstanceRemedy?: boolean(name='SpotInstanceRemedy'),
  vSwitchIds?: [ string ](name='VSwitchIds'),
}

model ModifyScalingGroupResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyScalingGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyScalingGroupResponseBody(name='body'),
}

async function modifyScalingGroupWithOptions(request: ModifyScalingGroupRequest, runtime: Util.RuntimeOptions): ModifyScalingGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.activeScalingConfigurationId)) {
    query['ActiveScalingConfigurationId'] = request.activeScalingConfigurationId;
  }
  if (!Util.isUnset(request.allocationStrategy)) {
    query['AllocationStrategy'] = request.allocationStrategy;
  }
  if (!Util.isUnset(request.azBalance)) {
    query['AzBalance'] = request.azBalance;
  }
  if (!Util.isUnset(request.compensateWithOnDemand)) {
    query['CompensateWithOnDemand'] = request.compensateWithOnDemand;
  }
  if (!Util.isUnset(request.defaultCooldown)) {
    query['DefaultCooldown'] = request.defaultCooldown;
  }
  if (!Util.isUnset(request.desiredCapacity)) {
    query['DesiredCapacity'] = request.desiredCapacity;
  }
  if (!Util.isUnset(request.groupDeletionProtection)) {
    query['GroupDeletionProtection'] = request.groupDeletionProtection;
  }
  if (!Util.isUnset(request.healthCheckType)) {
    query['HealthCheckType'] = request.healthCheckType;
  }
  if (!Util.isUnset(request.launchTemplateId)) {
    query['LaunchTemplateId'] = request.launchTemplateId;
  }
  if (!Util.isUnset(request.launchTemplateOverride)) {
    query['LaunchTemplateOverride'] = request.launchTemplateOverride;
  }
  if (!Util.isUnset(request.launchTemplateVersion)) {
    query['LaunchTemplateVersion'] = request.launchTemplateVersion;
  }
  if (!Util.isUnset(request.maxInstanceLifetime)) {
    query['MaxInstanceLifetime'] = request.maxInstanceLifetime;
  }
  if (!Util.isUnset(request.maxSize)) {
    query['MaxSize'] = request.maxSize;
  }
  if (!Util.isUnset(request.minSize)) {
    query['MinSize'] = request.minSize;
  }
  if (!Util.isUnset(request.multiAZPolicy)) {
    query['MultiAZPolicy'] = request.multiAZPolicy;
  }
  if (!Util.isUnset(request.onDemandBaseCapacity)) {
    query['OnDemandBaseCapacity'] = request.onDemandBaseCapacity;
  }
  if (!Util.isUnset(request.onDemandPercentageAboveBaseCapacity)) {
    query['OnDemandPercentageAboveBaseCapacity'] = request.onDemandPercentageAboveBaseCapacity;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  if (!Util.isUnset(request.scalingGroupName)) {
    query['ScalingGroupName'] = request.scalingGroupName;
  }
  if (!Util.isUnset(request.spotAllocationStrategy)) {
    query['SpotAllocationStrategy'] = request.spotAllocationStrategy;
  }
  if (!Util.isUnset(request.spotInstancePools)) {
    query['SpotInstancePools'] = request.spotInstancePools;
  }
  if (!Util.isUnset(request.spotInstanceRemedy)) {
    query['SpotInstanceRemedy'] = request.spotInstanceRemedy;
  }
  if (!Util.isUnset(request.vSwitchIds)) {
    query['VSwitchIds'] = request.vSwitchIds;
  }
  if (!Util.isUnset(request.removalPolicy)) {
    query['RemovalPolicy'] = request.removalPolicy;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyScalingGroup',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyScalingGroup(request: ModifyScalingGroupRequest): ModifyScalingGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyScalingGroupWithOptions(request, runtime);
}

model ModifyScalingRuleRequest {
  adjustmentType?: string(name='AdjustmentType'),
  adjustmentValue?: int32(name='AdjustmentValue'),
  cooldown?: int32(name='Cooldown'),
  disableScaleIn?: boolean(name='DisableScaleIn'),
  estimatedInstanceWarmup?: int32(name='EstimatedInstanceWarmup'),
  initialMaxSize?: int32(name='InitialMaxSize'),
  metricName?: string(name='MetricName'),
  minAdjustmentMagnitude?: int32(name='MinAdjustmentMagnitude'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  predictiveScalingMode?: string(name='PredictiveScalingMode'),
  predictiveTaskBufferTime?: int32(name='PredictiveTaskBufferTime'),
  predictiveValueBehavior?: string(name='PredictiveValueBehavior'),
  predictiveValueBuffer?: int32(name='PredictiveValueBuffer'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scaleInEvaluationCount?: int32(name='ScaleInEvaluationCount'),
  scaleOutEvaluationCount?: int32(name='ScaleOutEvaluationCount'),
  scalingRuleId?: string(name='ScalingRuleId'),
  scalingRuleName?: string(name='ScalingRuleName'),
  stepAdjustment?: [ 
    {
      metricIntervalLowerBound?: float(name='MetricIntervalLowerBound'),
      metricIntervalUpperBound?: float(name='MetricIntervalUpperBound'),
      scalingAdjustment?: int32(name='ScalingAdjustment'),
    }
  ](name='StepAdjustment'),
  targetValue?: float(name='TargetValue'),
}

model ModifyScalingRuleResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyScalingRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyScalingRuleResponseBody(name='body'),
}

async function modifyScalingRuleWithOptions(request: ModifyScalingRuleRequest, runtime: Util.RuntimeOptions): ModifyScalingRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.adjustmentType)) {
    query['AdjustmentType'] = request.adjustmentType;
  }
  if (!Util.isUnset(request.adjustmentValue)) {
    query['AdjustmentValue'] = request.adjustmentValue;
  }
  if (!Util.isUnset(request.cooldown)) {
    query['Cooldown'] = request.cooldown;
  }
  if (!Util.isUnset(request.disableScaleIn)) {
    query['DisableScaleIn'] = request.disableScaleIn;
  }
  if (!Util.isUnset(request.estimatedInstanceWarmup)) {
    query['EstimatedInstanceWarmup'] = request.estimatedInstanceWarmup;
  }
  if (!Util.isUnset(request.initialMaxSize)) {
    query['InitialMaxSize'] = request.initialMaxSize;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.minAdjustmentMagnitude)) {
    query['MinAdjustmentMagnitude'] = request.minAdjustmentMagnitude;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.predictiveScalingMode)) {
    query['PredictiveScalingMode'] = request.predictiveScalingMode;
  }
  if (!Util.isUnset(request.predictiveTaskBufferTime)) {
    query['PredictiveTaskBufferTime'] = request.predictiveTaskBufferTime;
  }
  if (!Util.isUnset(request.predictiveValueBehavior)) {
    query['PredictiveValueBehavior'] = request.predictiveValueBehavior;
  }
  if (!Util.isUnset(request.predictiveValueBuffer)) {
    query['PredictiveValueBuffer'] = request.predictiveValueBuffer;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scaleInEvaluationCount)) {
    query['ScaleInEvaluationCount'] = request.scaleInEvaluationCount;
  }
  if (!Util.isUnset(request.scaleOutEvaluationCount)) {
    query['ScaleOutEvaluationCount'] = request.scaleOutEvaluationCount;
  }
  if (!Util.isUnset(request.scalingRuleId)) {
    query['ScalingRuleId'] = request.scalingRuleId;
  }
  if (!Util.isUnset(request.scalingRuleName)) {
    query['ScalingRuleName'] = request.scalingRuleName;
  }
  if (!Util.isUnset(request.stepAdjustment)) {
    query['StepAdjustment'] = request.stepAdjustment;
  }
  if (!Util.isUnset(request.targetValue)) {
    query['TargetValue'] = request.targetValue;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyScalingRule',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyScalingRule(request: ModifyScalingRuleRequest): ModifyScalingRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyScalingRuleWithOptions(request, runtime);
}

model ModifyScheduledTaskRequest {
  description?: string(name='Description'),
  desiredCapacity?: int32(name='DesiredCapacity'),
  launchExpirationTime?: int32(name='LaunchExpirationTime'),
  launchTime?: string(name='LaunchTime'),
  maxValue?: int32(name='MaxValue'),
  minValue?: int32(name='MinValue'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  recurrenceEndTime?: string(name='RecurrenceEndTime'),
  recurrenceType?: string(name='RecurrenceType'),
  recurrenceValue?: string(name='RecurrenceValue'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scalingGroupId?: string(name='ScalingGroupId'),
  scheduledAction?: string(name='ScheduledAction'),
  scheduledTaskId?: string(name='ScheduledTaskId'),
  scheduledTaskName?: string(name='ScheduledTaskName'),
  taskEnabled?: boolean(name='TaskEnabled'),
}

model ModifyScheduledTaskResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyScheduledTaskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyScheduledTaskResponseBody(name='body'),
}

async function modifyScheduledTaskWithOptions(request: ModifyScheduledTaskRequest, runtime: Util.RuntimeOptions): ModifyScheduledTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.desiredCapacity)) {
    query['DesiredCapacity'] = request.desiredCapacity;
  }
  if (!Util.isUnset(request.launchExpirationTime)) {
    query['LaunchExpirationTime'] = request.launchExpirationTime;
  }
  if (!Util.isUnset(request.launchTime)) {
    query['LaunchTime'] = request.launchTime;
  }
  if (!Util.isUnset(request.maxValue)) {
    query['MaxValue'] = request.maxValue;
  }
  if (!Util.isUnset(request.minValue)) {
    query['MinValue'] = request.minValue;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.recurrenceEndTime)) {
    query['RecurrenceEndTime'] = request.recurrenceEndTime;
  }
  if (!Util.isUnset(request.recurrenceType)) {
    query['RecurrenceType'] = request.recurrenceType;
  }
  if (!Util.isUnset(request.recurrenceValue)) {
    query['RecurrenceValue'] = request.recurrenceValue;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  if (!Util.isUnset(request.scheduledAction)) {
    query['ScheduledAction'] = request.scheduledAction;
  }
  if (!Util.isUnset(request.scheduledTaskId)) {
    query['ScheduledTaskId'] = request.scheduledTaskId;
  }
  if (!Util.isUnset(request.scheduledTaskName)) {
    query['ScheduledTaskName'] = request.scheduledTaskName;
  }
  if (!Util.isUnset(request.taskEnabled)) {
    query['TaskEnabled'] = request.taskEnabled;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyScheduledTask',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyScheduledTask(request: ModifyScheduledTaskRequest): ModifyScheduledTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyScheduledTaskWithOptions(request, runtime);
}

model RebalanceInstancesRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model RebalanceInstancesResponseBody = {
  requestId?: string(name='RequestId'),
  scalingActivityId?: string(name='ScalingActivityId'),
}

model RebalanceInstancesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RebalanceInstancesResponseBody(name='body'),
}

async function rebalanceInstancesWithOptions(request: RebalanceInstancesRequest, runtime: Util.RuntimeOptions): RebalanceInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RebalanceInstances',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function rebalanceInstances(request: RebalanceInstancesRequest): RebalanceInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return rebalanceInstancesWithOptions(request, runtime);
}

model RecordLifecycleActionHeartbeatRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  heartbeatTimeout?: int32(name='heartbeatTimeout'),
  lifecycleActionToken?: string(name='lifecycleActionToken'),
  lifecycleHookId?: string(name='lifecycleHookId'),
}

model RecordLifecycleActionHeartbeatResponseBody = {
  requestId?: string(name='RequestId'),
}

model RecordLifecycleActionHeartbeatResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RecordLifecycleActionHeartbeatResponseBody(name='body'),
}

async function recordLifecycleActionHeartbeatWithOptions(request: RecordLifecycleActionHeartbeatRequest, runtime: Util.RuntimeOptions): RecordLifecycleActionHeartbeatResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.heartbeatTimeout)) {
    query['heartbeatTimeout'] = request.heartbeatTimeout;
  }
  if (!Util.isUnset(request.lifecycleActionToken)) {
    query['lifecycleActionToken'] = request.lifecycleActionToken;
  }
  if (!Util.isUnset(request.lifecycleHookId)) {
    query['lifecycleHookId'] = request.lifecycleHookId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RecordLifecycleActionHeartbeat',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function recordLifecycleActionHeartbeat(request: RecordLifecycleActionHeartbeatRequest): RecordLifecycleActionHeartbeatResponse {
  var runtime = new Util.RuntimeOptions{};
  return recordLifecycleActionHeartbeatWithOptions(request, runtime);
}

model RemoveInstancesRequest {
  decreaseDesiredCapacity?: boolean(name='DecreaseDesiredCapacity'),
  instanceId?: [ string ](name='InstanceId'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  removePolicy?: string(name='RemovePolicy'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model RemoveInstancesResponseBody = {
  requestId?: string(name='RequestId'),
  scalingActivityId?: string(name='ScalingActivityId'),
}

model RemoveInstancesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RemoveInstancesResponseBody(name='body'),
}

async function removeInstancesWithOptions(request: RemoveInstancesRequest, runtime: Util.RuntimeOptions): RemoveInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.decreaseDesiredCapacity)) {
    query['DecreaseDesiredCapacity'] = request.decreaseDesiredCapacity;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.removePolicy)) {
    query['RemovePolicy'] = request.removePolicy;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveInstances',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeInstances(request: RemoveInstancesRequest): RemoveInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeInstancesWithOptions(request, runtime);
}

model ResumeProcessesRequest {
  clientToken?: string(name='ClientToken'),
  ownerId?: long(name='OwnerId'),
  process?: [ string ](name='Process'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model ResumeProcessesResponseBody = {
  requestId?: string(name='RequestId'),
}

model ResumeProcessesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ResumeProcessesResponseBody(name='body'),
}

async function resumeProcessesWithOptions(request: ResumeProcessesRequest, runtime: Util.RuntimeOptions): ResumeProcessesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.process)) {
    query['Process'] = request.process;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ResumeProcesses',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function resumeProcesses(request: ResumeProcessesRequest): ResumeProcessesResponse {
  var runtime = new Util.RuntimeOptions{};
  return resumeProcessesWithOptions(request, runtime);
}

model ScaleWithAdjustmentRequest {
  adjustmentType?: string(name='AdjustmentType'),
  adjustmentValue?: int32(name='AdjustmentValue'),
  clientToken?: string(name='ClientToken'),
  minAdjustmentMagnitude?: int32(name='MinAdjustmentMagnitude'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
  syncActivity?: boolean(name='SyncActivity'),
}

model ScaleWithAdjustmentResponseBody = {
  requestId?: string(name='RequestId'),
  scalingActivityId?: string(name='ScalingActivityId'),
}

model ScaleWithAdjustmentResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ScaleWithAdjustmentResponseBody(name='body'),
}

async function scaleWithAdjustmentWithOptions(request: ScaleWithAdjustmentRequest, runtime: Util.RuntimeOptions): ScaleWithAdjustmentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.adjustmentType)) {
    query['AdjustmentType'] = request.adjustmentType;
  }
  if (!Util.isUnset(request.adjustmentValue)) {
    query['AdjustmentValue'] = request.adjustmentValue;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.minAdjustmentMagnitude)) {
    query['MinAdjustmentMagnitude'] = request.minAdjustmentMagnitude;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  if (!Util.isUnset(request.syncActivity)) {
    query['SyncActivity'] = request.syncActivity;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ScaleWithAdjustment',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function scaleWithAdjustment(request: ScaleWithAdjustmentRequest): ScaleWithAdjustmentResponse {
  var runtime = new Util.RuntimeOptions{};
  return scaleWithAdjustmentWithOptions(request, runtime);
}

model SetGroupDeletionProtectionRequest {
  groupDeletionProtection?: boolean(name='GroupDeletionProtection'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model SetGroupDeletionProtectionResponseBody = {
  requestId?: string(name='RequestId'),
}

model SetGroupDeletionProtectionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetGroupDeletionProtectionResponseBody(name='body'),
}

async function setGroupDeletionProtectionWithOptions(request: SetGroupDeletionProtectionRequest, runtime: Util.RuntimeOptions): SetGroupDeletionProtectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupDeletionProtection)) {
    query['GroupDeletionProtection'] = request.groupDeletionProtection;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetGroupDeletionProtection',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setGroupDeletionProtection(request: SetGroupDeletionProtectionRequest): SetGroupDeletionProtectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return setGroupDeletionProtectionWithOptions(request, runtime);
}

model SetInstanceHealthRequest {
  healthStatus?: string(name='HealthStatus'),
  instanceId?: string(name='InstanceId'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
}

model SetInstanceHealthResponseBody = {
  requestId?: string(name='RequestId'),
}

model SetInstanceHealthResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetInstanceHealthResponseBody(name='body'),
}

async function setInstanceHealthWithOptions(request: SetInstanceHealthRequest, runtime: Util.RuntimeOptions): SetInstanceHealthResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.healthStatus)) {
    query['HealthStatus'] = request.healthStatus;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetInstanceHealth',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setInstanceHealth(request: SetInstanceHealthRequest): SetInstanceHealthResponse {
  var runtime = new Util.RuntimeOptions{};
  return setInstanceHealthWithOptions(request, runtime);
}

model SetInstancesProtectionRequest {
  instanceId?: [ string ](name='InstanceId'),
  ownerId?: long(name='OwnerId'),
  protectedFromScaleIn?: boolean(name='ProtectedFromScaleIn'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model SetInstancesProtectionResponseBody = {
  requestId?: string(name='RequestId'),
}

model SetInstancesProtectionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetInstancesProtectionResponseBody(name='body'),
}

async function setInstancesProtectionWithOptions(request: SetInstancesProtectionRequest, runtime: Util.RuntimeOptions): SetInstancesProtectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.protectedFromScaleIn)) {
    query['ProtectedFromScaleIn'] = request.protectedFromScaleIn;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetInstancesProtection',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setInstancesProtection(request: SetInstancesProtectionRequest): SetInstancesProtectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return setInstancesProtectionWithOptions(request, runtime);
}

model SuspendProcessesRequest {
  clientToken?: string(name='ClientToken'),
  ownerId?: long(name='OwnerId'),
  process?: [ string ](name='Process'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  scalingGroupId?: string(name='ScalingGroupId'),
}

model SuspendProcessesResponseBody = {
  requestId?: string(name='RequestId'),
}

model SuspendProcessesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SuspendProcessesResponseBody(name='body'),
}

async function suspendProcessesWithOptions(request: SuspendProcessesRequest, runtime: Util.RuntimeOptions): SuspendProcessesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.process)) {
    query['Process'] = request.process;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.scalingGroupId)) {
    query['ScalingGroupId'] = request.scalingGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SuspendProcesses',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function suspendProcesses(request: SuspendProcessesRequest): SuspendProcessesResponse {
  var runtime = new Util.RuntimeOptions{};
  return suspendProcessesWithOptions(request, runtime);
}

model TagResourcesRequest {
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceId?: [ string ](name='ResourceId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceType?: string(name='ResourceType'),
  tag?: [ 
    {
      key?: string(name='Key'),
      propagate?: boolean(name='Propagate'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId'),
}

model TagResourcesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: TagResourcesResponseBody(name='body'),
}

async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: Util.RuntimeOptions): TagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TagResources',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model UntagResourcesRequest {
  all?: boolean(name='All'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceId?: [ string ](name='ResourceId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceType?: string(name='ResourceType'),
  tagKey?: [ string ](name='TagKey'),
}

model UntagResourcesResponseBody = {
  requestId?: string(name='RequestId'),
}

model UntagResourcesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UntagResourcesResponseBody(name='body'),
}

async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: Util.RuntimeOptions): UntagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tagKey)) {
    query['TagKey'] = request.tagKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UntagResources',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return untagResourcesWithOptions(request, runtime);
}

model VerifyAuthenticationRequest {
  onlyCheck?: boolean(name='OnlyCheck'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  uid?: long(name='Uid'),
}

model VerifyAuthenticationResponseBody = {
  requestId?: string(name='RequestId'),
}

model VerifyAuthenticationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: VerifyAuthenticationResponseBody(name='body'),
}

async function verifyAuthenticationWithOptions(request: VerifyAuthenticationRequest, runtime: Util.RuntimeOptions): VerifyAuthenticationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.onlyCheck)) {
    query['OnlyCheck'] = request.onlyCheck;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'VerifyAuthentication',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function verifyAuthentication(request: VerifyAuthenticationRequest): VerifyAuthenticationResponse {
  var runtime = new Util.RuntimeOptions{};
  return verifyAuthenticationWithOptions(request, runtime);
}

model VerifyUserRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model VerifyUserResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function verifyUserWithOptions(request: VerifyUserRequest, runtime: Util.RuntimeOptions): VerifyUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'VerifyUser',
    version = '2014-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

async function verifyUser(request: VerifyUserRequest): VerifyUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return verifyUserWithOptions(request, runtime);
}

